From nobody Sat Nov 23 15:25:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=posteo.net ARC-Seal: i=1; a=rsa-sha256; t=1732206190; cv=none; d=zohomail.com; s=zohoarc; b=G6PHHRDbfM+dREy4RiD8kooR3byeRRrC7TT4XVZncQG6RAxSqnVnw+/IGU4jQDRHCeexRezYRTs7RE0mifKOAa3EIjptw27aSMDOwqEASdl45TkeXIulUSrOOfCgrFFD0DxgnEajb7rXZteYQQAYINuccmC5OTbx8YzPzoZ7qE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732206190; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BpFfoSP3IX1TsuGOylISJHbNFEK8uITkXSb4iYVnZgQ=; b=k6aRGp7OWwoG7kllArN3NGQCgco+NG7UvUZ1iMriaOlnmB6daRRbzJ1VJKyC6eUg/mRusGO2LApbftSbBA0hXtYAAy/CgkAIN9TfNOeqsV5jIDpcU60oLzbNGzBEFu57ubWP7DIS8L9efq1kxIi+sKvx3KEsKGF/nRIx9cxyh4s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732206190585529.9792871710356; Thu, 21 Nov 2024 08:23:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tE9x5-00011Y-7v; Thu, 21 Nov 2024 11:22:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tE9x3-00010z-9c for qemu-devel@nongnu.org; Thu, 21 Nov 2024 11:22:41 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tE9x1-0001Cv-Hi for qemu-devel@nongnu.org; Thu, 21 Nov 2024 11:22:40 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5ED08240101 for ; Thu, 21 Nov 2024 17:22:32 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XvNmm08qyz6tw6; Thu, 21 Nov 2024 17:22:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1732206153; bh=dX0H3zLmPY7rh6TPKPV6fcbuqthN9TQRCrXyn2GoFIQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=dQd/VoXgM/EPK+vtk8C+/W9ZjLsk4lDu23J9yMkgv+SQlLQqbfTOO1Hs577pojAQP huC91Tb/19vHseyXvnHdWxCuPkuBJLZtoIVk2SnhSYiDHfkftVEdL54rLdL2cxBoua e5UbSHGK415SKRnzMrGCTSnozCeQxMyokCZGzJT072jq5t1mE+YJ7SzG2jKnnMFq1E SiDyc9p6SyMxoMIAZoxM0THMdGXRDWxFnfuHgDNyePQFjGpuPrNddf2f4XmS57YtAV +fsS9ZUaN/s9NSzsnmE/sUTIO/VOprbeqwMWhzLjRRmWWqUX9JXx6SCryqJa061mLH 4oiE7NsrK00lg== From: Charalampos Mitrodimas To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, Charalampos Mitrodimas , Phil Dennis-Jordan Subject: [PATCH] ui/gtk: Fix event handling on macOS hosts Date: Thu, 21 Nov 2024 16:21:46 +0000 Message-Id: <20241121162146.53643-1-charmitro@posteo.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.67.36.66; envelope-from=charmitro@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @posteo.net) X-ZM-MESSAGEID: 1732206193383116600 Content-Type: text/plain; charset="utf-8" The GTK+ UI was not properly handling events on macOS due to missing event loop polling in the Cocoa backend. Add polling of the GLib main context during display refresh to ensure UI events are processed. This fixes UI responsiveness issues when running QEMU with the GTK display (--display gtk) on macOS hosts. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2676 Co-developed-by: Phil Dennis-Jordan Signed-off-by: Charalampos Mitrodimas Reviewed-by: Phil Dennis-Jordan Tested-by: Phil Dennis-Jordan --- ui/gtk.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ui/gtk.c b/ui/gtk.c index bf9d3dd679..979210255f 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -437,6 +437,15 @@ static void gd_update(DisplayChangeListener *dcl, =20 static void gd_refresh(DisplayChangeListener *dcl) { +#ifdef GDK_WINDOWING_QUARTZ + GMainContext *context; + if (GDK_IS_QUARTZ_DISPLAY(gdk_display_get_default())) { + context =3D g_main_context_default(); + while (g_main_context_pending(context)) { + g_main_context_iteration(context, FALSE); + } + } +#endif graphic_hw_update(dcl->con); } =20 --=20 2.39.5 (Apple Git-154)