All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongwon Kim <dongwon.kim@intel.com>
To: qemu-devel@nongnu.org
Cc: Khairul Anuar Romli <khairul.anuar.romli@intel.com>,
	Dongwon Kim <dongwon.kim@intel.com>
Subject: [PATCH 1/2] ui/gtk: detach_all option for making all VCs detached upon starting
Date: Mon, 19 Jul 2021 14:41:56 -0700	[thread overview]
Message-ID: <20210719214157.5863-1-dongwon.kim@intel.com> (raw)

With "detach-all=on" for display, all VCs are detached from the beginning.
This is useful when there are multiple displays assigned to a guest OS.

Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@intel.com>
---
 qapi/ui.json | 4 +++-
 ui/gtk.c     | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/qapi/ui.json b/qapi/ui.json
index 1052ca9c38..ff14bb2f46 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1141,6 +1141,7 @@
 # @show-cursor:   Force showing the mouse cursor (default: off).
 #                 (since: 5.0)
 # @gl:            Enable OpenGL support (default: off).
+# @detach-all:    Detatch all VirtualConsoles from beginning (default: off).
 #
 # Since: 2.12
 #
@@ -1150,7 +1151,8 @@
                 '*full-screen'   : 'bool',
                 '*window-close'  : 'bool',
                 '*show-cursor'   : 'bool',
-                '*gl'            : 'DisplayGLMode' },
+                '*gl'            : 'DisplayGLMode',
+                '*detach-all'    : 'bool' },
   'discriminator' : 'type',
   'data'    : { 'gtk'            : 'DisplayGTK',
                 'curses'         : 'DisplayCurses',
diff --git a/ui/gtk.c b/ui/gtk.c
index ce885d2ca3..a07e5a049e 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2211,6 +2211,7 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
     GdkDisplay *window_display;
     GtkIconTheme *theme;
     char *dir;
+    int i;
 
     if (!gtkinit) {
         fprintf(stderr, "gtk initialization failed\n");
@@ -2290,6 +2291,12 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
         gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
     }
     gd_clipboard_init(s);
+
+    if (opts->detach_all) {
+        for (i = 0; i < s->nb_vcs - 1; i++) {
+            gtk_menu_item_activate(GTK_MENU_ITEM(s->untabify_item));
+        }
+    }
 }
 
 static void early_gtk_display_init(DisplayOptions *opts)
-- 
2.17.1



             reply	other threads:[~2021-07-19 21:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19 21:41 Dongwon Kim [this message]
2021-07-19 21:41 ` [PATCH 2/2] ui/gtk: specify detached window's size and location Dongwon Kim
2021-07-20 13:42 ` [PATCH 1/2] ui/gtk: detach_all option for making all VCs detached upon starting Thomas Huth
2021-07-20 22:16   ` Dongwon Kim
2021-07-21  1:54     ` Romli, Khairul Anuar
2021-07-26 21:52 ` [PATCH v2 " Dongwon Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210719214157.5863-1-dongwon.kim@intel.com \
    --to=dongwon.kim@intel.com \
    --cc=khairul.anuar.romli@intel.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.