From nobody Sat Apr 12 18:03:26 2025 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=1656550726; cv=none; d=zohomail.com; s=zohoarc; b=WYmuoeP4rvbF0M95pVpw+iXV/d2d3oYlCnKdolgBLzVedmK00rL2DHhX1y2dRFWqhcoYSQvI4RWgLogWEhHcH49xgzI7bdg0SD2vlTpee3kKxt7FYZh4WGaQ3sjxRxkVRR8dcX1gjNU7Cd7lSbWb11dmFt3HU66L5KO4AJO+5zE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1656550726; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Bl4cVWj4L/anh3+SzbFl3BWmU9peiKEa0Uc4d1W54Z4=; b=n2iD4kx+D5bW+olTtfPyDGUQyAET2g8Jsj/NxFymuB7cY99JYwbfB0fInp9SIKqoiMOkBmNHP7XLJI2hlXX7Q1KJAFD3ogAjWkWXT8DwolZ9gv70zh6BiJieW/Eb87y8GbmVEOXuUFXkYL5ia2UbLZMWNdNmLAVSwFmymgwxN8M= 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 1656550726182253.85833689906428; Wed, 29 Jun 2022 17:58:46 -0700 (PDT) Received: from localhost ([::1]:43546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6iW4-0003G8-Sn for importer@patchew.org; Wed, 29 Jun 2022 20:58:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6iUt-0001NU-LX for qemu-devel@nongnu.org; Wed, 29 Jun 2022 20:57:31 -0400 Received: from mga17.intel.com ([192.55.52.151]:14891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6iUr-0005gL-Qx for qemu-devel@nongnu.org; Wed, 29 Jun 2022 20:57:31 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jun 2022 17:57:27 -0700 Received: from dongwonk-z390-aorus-ultra-intel-gfx.fm.intel.com ([10.105.129.122]) by fmsmga002.fm.intel.com with ESMTP; 29 Jun 2022 17:57:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656550649; x=1688086649; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=75CxAaiBQkvxr8y3tvdcFyTIBVBM+f9lX6UAdIlo1wY=; b=NV7OvcrpQM+mBcldonOo93W88LtnG6QGXXkLL6rgdpB/MWhWoeVSw4hz Up8JvBmUwc8MFr5gMOa1MzYiZ9kFtUFsqQd2YyKGj6lx8N/AOICJwius9 IMnsbcbh3n4tYJhtsoBnhqvgzZpipt480Cx85dZQwy2HX6i+SIDsR+DS1 nPjkgzam0BqFYb/f3C1A2KFuXIkhDE+WYd6c2VzeWuay2LaW+q/PTixUo 0rmo3T81hIYkeEw76KJPbJQKw+B3rcVI+tQZo9b1ulaggo3+GUntfPAn8 rGeGfYhTLJ91viqxfYptwnNnZh8VYZ710p1s6c7MQ6zATg/ikI35S6r26 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="262611180" X-IronPort-AV: E=Sophos;i="5.92,232,1650956400"; d="scan'208";a="262611180" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,232,1650956400"; d="scan'208";a="693828119" From: Dongwon Kim To: qemu-devel@nongnu.org Cc: Dongwon Kim , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Gerd Hoffmann , Vivek Kasireddy Subject: [PATCH v3 1/3] ui/gtk: detach VCs for additional guest displays Date: Wed, 29 Jun 2022 17:51:40 -0700 Message-Id: <20220630005141.16680-2-dongwon.kim@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220630005141.16680-1-dongwon.kim@intel.com> References: <20220630005141.16680-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=192.55.52.151; envelope-from=dongwon.kim@intel.com; helo=mga17.intel.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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" X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1656550728283100001 Detaching any addtional guest displays in case multiple displays are assigned to the guest OS (e.g. max_outputs=3Dn) so that all of them are visible upon lauching. v2: - making sure type of VC is GD_VC_GFX before qemu_console_is_graphic (Gerd Hoffman) - vc[0] is always primary guest display so we won't need n_gfx_vcs (Gerd Hoffmann) - making sure detached window's size same as original surface size (Daniel P. Berrang=C3=A9) Cc: Daniel P. Berrang=C3=A9 Cc: Markus Armbruster Cc: Philippe Mathieu-Daud=C3=A9 Cc: Paolo Bonzini Cc: Gerd Hoffmann Cc: Vivek Kasireddy Signed-off-by: Dongwon Kim --- ui/gtk.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index 2a791dd2aa..e6878c3209 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1361,6 +1361,11 @@ static void gd_menu_untabify(GtkMenuItem *item, void= *opaque) =20 g_signal_connect(vc->window, "delete-event", G_CALLBACK(gd_tab_window_close), vc); + + gtk_window_set_default_size(GTK_WINDOW(vc->window), + surface_width(vc->gfx.ds), + surface_height(vc->gfx.ds)); + gtk_widget_show_all(vc->window); =20 if (qemu_console_is_graphic(vc->gfx.dcl.con)) { @@ -2311,6 +2316,7 @@ static void gtk_display_init(DisplayState *ds, Displa= yOptions *opts) GtkDisplayState *s =3D g_malloc0(sizeof(*s)); GdkDisplay *window_display; GtkIconTheme *theme; + int i; char *dir; =20 if (!gtkinit) { @@ -2381,7 +2387,12 @@ static void gtk_display_init(DisplayState *ds, Displ= ayOptions *opts) gtk_widget_set_sensitive(s->copy_item, vc && vc->type =3D=3D GD_VC_VTE); #endif - + for (i =3D 1; i < s->nb_vcs; i++) { + if (vc->type =3D=3D GD_VC_GFX && + qemu_console_is_graphic(s->vc[i].gfx.dcl.con)) { + gtk_menu_item_activate(GTK_MENU_ITEM(s->untabify_item)); + } + } if (opts->has_full_screen && opts->full_screen) { gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item)); --=20 2.30.2