qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] gtk: Add show_tabs=on|off command line option.
@ 2022-07-12 13:37 Felix xq Queißner
  2022-07-12 14:17 ` Hanna Reitz
  2022-07-18  9:57 ` Thomas Huth
  0 siblings, 2 replies; 3+ messages in thread
From: Felix xq Queißner @ 2022-07-12 13:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, kraxel, hreitz, Felix "xq" Queißner

The patch adds "show_tabs" command line option for GTK ui similar to
"grab_on_hover". This option allows tabbed view mode to not have to be
enabled by hand at each start of the VM.

Signed-off-by: Felix "xq" Queißner <xq@random-projects.net>
---
 qapi/ui.json    | 7 ++++++-
 qemu-options.hx | 6 +++++-
 ui/gtk.c        | 4 ++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/qapi/ui.json b/qapi/ui.json
index 413371d5e8..cf58ab4283 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1195,12 +1195,17 @@
 #               assuming the guest will resize the display to match
 #               the window size then.  Otherwise it defaults to "off".
 #               Since 3.1
+# @show-tabs:   Display the tab bar for switching between the various graphical
+#               interfaces (e.g. VGA and virtual console character devices)
+#               by default.
+#               Since 7.1
 #
 # Since: 2.12
 ##
 { 'struct'  : 'DisplayGTK',
   'data'    : { '*grab-on-hover' : 'bool',
-                '*zoom-to-fit'   : 'bool'  } }
+                '*zoom-to-fit'   : 'bool',
+                '*show-tabs'     : 'bool'  } }
 
 ##
 # @DisplayEGLHeadless:
diff --git a/qemu-options.hx b/qemu-options.hx
index 377d22fbd8..79e00916a1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1938,7 +1938,7 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
 #endif
 #if defined(CONFIG_GTK)
     "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
-    "            [,show-cursor=on|off][,window-close=on|off]\n"
+    "            [,show-tabs=on|off][,show-cursor=on|off][,window-close=on|off]\n"
 #endif
 #if defined(CONFIG_VNC)
     "-display vnc=<display>[,<optargs>]\n"
@@ -2023,6 +2023,10 @@ SRST
 
         ``grab-on-hover=on|off`` : Grab keyboard input on mouse hover
 
+        ``show-tabs=on|off`` : Display the tab bar for switching between the
+                               various graphical interfaces (e.g. VGA and
+                               virtual console character devices) by default.
+
         ``show-cursor=on|off`` :  Force showing the mouse cursor
 
         ``window-close=on|off`` : Allow to quit qemu with window close button
diff --git a/ui/gtk.c b/ui/gtk.c
index 2a791dd2aa..1467b8c7d7 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2390,6 +2390,10 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
         opts->u.gtk.grab_on_hover) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
     }
+    if (opts->u.gtk.has_show_tabs &&
+        opts->u.gtk.show_tabs) {
+        gtk_menu_item_activate(GTK_MENU_ITEM(s->show_tabs_item));
+    }
     gd_clipboard_init(s);
 }
 
-- 
2.36.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] gtk: Add show_tabs=on|off command line option.
  2022-07-12 13:37 [PATCH v2] gtk: Add show_tabs=on|off command line option Felix xq Queißner
@ 2022-07-12 14:17 ` Hanna Reitz
  2022-07-18  9:57 ` Thomas Huth
  1 sibling, 0 replies; 3+ messages in thread
From: Hanna Reitz @ 2022-07-12 14:17 UTC (permalink / raw)
  To: Felix xq Queißner, qemu-devel; +Cc: thuth, kraxel

On 12.07.22 15:37, Felix xq Queißner wrote:
> The patch adds "show_tabs" command line option for GTK ui similar to
> "grab_on_hover". This option allows tabbed view mode to not have to be
> enabled by hand at each start of the VM.
>
> Signed-off-by: Felix "xq" Queißner <xq@random-projects.net>
> ---
>   qapi/ui.json    | 7 ++++++-
>   qemu-options.hx | 6 +++++-
>   ui/gtk.c        | 4 ++++
>   3 files changed, 15 insertions(+), 2 deletions(-)

Reviewed-by: Hanna Reitz <hreitz@redhat.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] gtk: Add show_tabs=on|off command line option.
  2022-07-12 13:37 [PATCH v2] gtk: Add show_tabs=on|off command line option Felix xq Queißner
  2022-07-12 14:17 ` Hanna Reitz
@ 2022-07-18  9:57 ` Thomas Huth
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2022-07-18  9:57 UTC (permalink / raw)
  To: Felix xq Queißner, qemu-devel; +Cc: kraxel, hreitz

On 12/07/2022 15.37, Felix xq Queißner wrote:
> The patch adds "show_tabs" command line option for GTK ui similar to
> "grab_on_hover". This option allows tabbed view mode to not have to be
> enabled by hand at each start of the VM.

Nit: In case you have to respin again, please replace "show_tabs" with 
"show-tabs" and "grab_on_hover" with "grab-on-hover". Anyway:

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-18  9:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-12 13:37 [PATCH v2] gtk: Add show_tabs=on|off command line option Felix xq Queißner
2022-07-12 14:17 ` Hanna Reitz
2022-07-18  9:57 ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).