From nobody Tue Nov 26 16:17:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1706658643; cv=none; d=zohomail.com; s=zohoarc; b=CSB+yppnqXy0yOHCFyq48FvTxOOzS475huS/EVtVFi1DitmfePhtMQQJf90A01b2lPOtVCM8UZqc2/tL20OC+9ZbfGjUpwn9tB6qkQXru0ExEChXsBdZMMmYXCs5p1kOzpj7QWNV3RUuWWhfZ4Ou1fXJOdQxwYVhBqQtl5g9BUQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706658643; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=bf0GbJJaP4jEs6mz+409foojiX/n2HlH8bUZwaJ8at8=; b=dFcJOxo54btD6ykTeMs4WERx/9f8u5O4OaWlxTmyHpsSBHjA2RbSMhUJSS4TdDH3VGm1qeQgUC3t93flJtmnvQKje7g1i8odEudYMQ+gd0SKWLsRngwdwGpXlC89VivUON86wGjnv5d3E63lfBZW4GK7Z9n+Fn9AKYiUJ0LiluI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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 1706658643944994.7067143645145; Tue, 30 Jan 2024 15:50:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUxrE-0000ph-98; Tue, 30 Jan 2024 18:49:36 -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 1rUxrC-0000pQ-Nn for qemu-devel@nongnu.org; Tue, 30 Jan 2024 18:49:34 -0500 Received: from mgamail.intel.com ([134.134.136.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUxrA-0003aZ-IT for qemu-devel@nongnu.org; Tue, 30 Jan 2024 18:49:34 -0500 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 15:49:23 -0800 Received: from dongwonk-z390-aorus-ultra.fm.intel.com ([10.105.129.124]) by orsmga003.jf.intel.com with ESMTP; 30 Jan 2024 15:49:23 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706658572; x=1738194572; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=bb/3yJcemveiuLaTpVp3K/Yfk9j4pt1mh8V2LegPHPE=; b=WFnrWlakIX8YZdPD/tqXckZ80vN8vySu+pckwN59+2Dxnl/FaS+ZUTNQ c/ZyIoBtQohweTPVuMxyojQyBgbu98YwKpjiD8HxQnDdS0HzP8NFEpsMR 3J7ZJvFOjYezfoqNxhClu/nWB9/o/E26F8aqU5CeoPZ/bHXAxleBDZTh5 iirvGLUhuLZpL1pQ+ZQE7xChvWeuadrE5Lag9v/R1DWYE11ksYh+idvXq 6+jjm9qu8SX2XYqe2KwbuCz/BCJeiWtvEhZ3IhX/tTp8vKPPVvM4RfggU 9zpiCbVGGAjjkAQjtBk0fMm9TDPWO7GPd3y6u6PjjMRjKNHmpFM2mfkeO A==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="393887940" X-IronPort-AV: E=Sophos;i="6.05,230,1701158400"; d="scan'208";a="393887940" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="737919635" X-IronPort-AV: E=Sophos;i="6.05,230,1701158400"; d="scan'208";a="737919635" From: dongwon.kim@intel.com To: qemu-devel@nongnu.org Subject: [PATCH 2/3] ui/gtk: set the ui size to 0 when invisible Date: Tue, 30 Jan 2024 15:48:39 -0800 Message-Id: <20240130234840.53122-3-dongwon.kim@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240130234840.53122-1-dongwon.kim@intel.com> References: <20240130234840.53122-1-dongwon.kim@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=134.134.136.20; envelope-from=dongwon.kim@intel.com; helo=mgamail.intel.com X-Spam_score_int: -56 X-Spam_score: -5.7 X-Spam_bar: ----- X-Spam_report: (-5.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.292, 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @intel.com) X-ZM-MESSAGEID: 1706658645524100003 From: Dongwon Kim UI size is set to 0 when the VC is invisible, which will prevent the further scanout update by notifying the guest that the display is not in active state. Then it is restored to the original size whenever the VC becomes visible again. Cc: Marc-Andr=C3=A9 Lureau Cc: Gerd Hoffmann Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- ui/gtk.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index 02eb667d8a..651ed3492f 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1314,10 +1314,12 @@ static void gd_menu_switch_vc(GtkMenuItem *item, vo= id *opaque) GtkDisplayState *s =3D opaque; VirtualConsole *vc; GtkNotebook *nb =3D GTK_NOTEBOOK(s->notebook); + GdkWindow *window; gint page; =20 vc =3D gd_vc_find_current(s); vc->gfx.visible =3D false; + gd_set_ui_size(vc, 0, 0); =20 vc =3D gd_vc_find_by_menu(s); gtk_release_modifiers(s); @@ -1325,6 +1327,9 @@ static void gd_menu_switch_vc(GtkMenuItem *item, void= *opaque) page =3D gtk_notebook_page_num(nb, vc->tab_item); gtk_notebook_set_current_page(nb, page); gtk_widget_grab_focus(vc->focus); + window =3D gtk_widget_get_window(vc->gfx.drawing_area); + gd_set_ui_size(vc, gdk_window_get_width(window), + gdk_window_get_height(window)); vc->gfx.visible =3D true; } } @@ -1356,6 +1361,7 @@ static gboolean gd_tab_window_close(GtkWidget *widget= , GdkEvent *event, GtkDisplayState *s =3D vc->s; =20 vc->gfx.visible =3D false; + gd_set_ui_size(vc, 0, 0); gtk_widget_set_sensitive(vc->menu_item, true); gd_widget_reparent(vc->window, s->notebook, vc->tab_item); gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(s->notebook), @@ -1391,6 +1397,7 @@ static gboolean gd_win_grab(void *opaque) static void gd_menu_untabify(GtkMenuItem *item, void *opaque) { GtkDisplayState *s =3D opaque; + GdkWindow *window; VirtualConsole *vc =3D gd_vc_find_current(s); =20 if (vc->type =3D=3D GD_VC_GFX && @@ -1429,6 +1436,10 @@ static void gd_menu_untabify(GtkMenuItem *item, void= *opaque) gd_update_geometry_hints(vc); gd_update_caption(s); } + + window =3D gtk_widget_get_window(vc->gfx.drawing_area); + gd_set_ui_size(vc, gdk_window_get_width(window), + gdk_window_get_height(window)); vc->gfx.visible =3D true; } =20 @@ -1753,7 +1764,9 @@ static gboolean gd_configure(GtkWidget *widget, { VirtualConsole *vc =3D opaque; =20 - gd_set_ui_size(vc, cfg->width, cfg->height); + if (vc->gfx.visible) { + gd_set_ui_size(vc, cfg->width, cfg->height); + } return FALSE; } =20 --=20 2.34.1