qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option.
@ 2016-02-26  9:51 Igor S
  2022-06-23 14:36 ` Felix Queißner
  0 siblings, 1 reply; 6+ messages in thread
From: Igor S @ 2016-02-26  9:51 UTC (permalink / raw)
  To: qemu-devel

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: Igor Sudarikov <4seev3@gmail.com>
---
 include/ui/console.h |  2 +-
 qemu-options.hx      |  2 +-
 ui/gtk.c             |  5 ++++-
 vl.c                 | 12 +++++++++++-
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 6631b96..71132aa 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -453,6 +453,6 @@ int index_from_key(const char *key, size_t key_length);
 
 /* gtk.c */
 void early_gtk_display_init(int opengl);
-void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover);
+void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover, bool show_tabs);
 
 #endif
diff --git a/qemu-options.hx b/qemu-options.hx
index f528405..1c2e9ae 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -930,7 +930,7 @@ ETEXI
 DEF("display", HAS_ARG, QEMU_OPTION_display,
     "-display sdl[,frame=on|off][,alt_grab=on|off][,ctrl_grab=on|off]\n"
     "            [,window_close=on|off]|curses|none|\n"
-    "            gtk[,grab_on_hover=on|off]|\n"
+    "            gtk[,grab_on_hover=on|off][,show_tabs=on|off]|\n"
     "            vnc=<display>[,<optargs>]\n"
     "                select display type\n", QEMU_ARCH_ALL)
 STEXI
diff --git a/ui/gtk.c b/ui/gtk.c
index 3773826..8800eca 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2071,7 +2071,7 @@ static void gd_set_keycode_type(GtkDisplayState *s)
 
 static gboolean gtkinit;
 
-void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
+void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover, bool show_tabs)
 {
     GtkDisplayState *s = g_malloc0(sizeof(*s));
     char *filename;
@@ -2157,6 +2157,9 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
     if (grab_on_hover) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
     }
+    if (show_tabs) {
+        gtk_menu_item_activate(GTK_MENU_ITEM(s->show_tabs_item));
+    }
 
     gd_set_keycode_type(s);
 }
diff --git a/vl.c b/vl.c
index b87e292..e553611 100644
--- a/vl.c
+++ b/vl.c
@@ -146,6 +146,7 @@ static int no_frame = 0;
 int no_quit = 0;
 #ifdef CONFIG_GTK
 static bool grab_on_hover;
+static bool show_tabs;
 #endif
 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
 CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
@@ -2194,6 +2195,15 @@ static DisplayType select_display(const char *p)
                 } else {
                     goto invalid_gtk_args;
                 }
+            } else if (strstart(opts, ",show_tabs=", &nextopt)) {
+                opts = nextopt;
+                if (strstart(opts, "on", &nextopt)) {
+                    show_tabs = true;
+                } else if (strstart(opts, "off", &nextopt)) {
+                    show_tabs = false;
+                } else {
+                    goto invalid_gtk_args;
+                }
             } else if (strstart(opts, ",gl=", &nextopt)) {
                 opts = nextopt;
                 if (strstart(opts, "on", &nextopt)) {
@@ -4567,7 +4577,7 @@ int main(int argc, char **argv, char **envp)
 #endif
 #if defined(CONFIG_GTK)
     case DT_GTK:
-        gtk_display_init(ds, full_screen, grab_on_hover);
+        gtk_display_init(ds, full_screen, grab_on_hover, show_tabs);
         break;
 #endif
     default:
-- 
2.7.0

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

* Re: [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option.
  2016-02-26  9:51 [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option Igor S
@ 2022-06-23 14:36 ` Felix Queißner
  2022-06-23 14:59   ` Thomas Huth
  0 siblings, 1 reply; 6+ messages in thread
From: Felix Queißner @ 2022-06-23 14:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel

Heya!

> 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.

It's been a while now, but i was always missing this feature in QEMU and 
i'd love to see that patch land in QEMU one day.

I discovered that patch by searching for "start qemu with tabs visible" 
and found this link:

https://patchwork.ozlabs.org/project/qemu-devel/patch/56D0203F.5060303@gmail.com/

Regards
- Felix



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

* Re: [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option.
  2022-06-23 14:36 ` Felix Queißner
@ 2022-06-23 14:59   ` Thomas Huth
  2022-06-23 15:00     ` Thomas Huth
  2022-06-23 15:05     ` Felix Queißner
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Huth @ 2022-06-23 14:59 UTC (permalink / raw)
  To: Felix Queißner, qemu-devel; +Cc: kraxel, Igor Sudarikov

On 23/06/2022 16.36, Felix Queißner wrote:
> Heya!
> 
>> 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.
> 
> It's been a while now, but i was always missing this feature in QEMU and i'd 
> love to see that patch land in QEMU one day.
> 
> I discovered that patch by searching for "start qemu with tabs visible" and 
> found this link:
> 
> https://patchwork.ozlabs.org/project/qemu-devel/patch/56D0203F.5060303@gmail.com/ 

Not sure why it was

That patch certainly needs a re-spin since it won't apply as-is anymore. 
Want to have a try?

  Thomas



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

* Re: [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option.
  2022-06-23 14:59   ` Thomas Huth
@ 2022-06-23 15:00     ` Thomas Huth
  2022-06-23 15:05     ` Felix Queißner
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2022-06-23 15:00 UTC (permalink / raw)
  To: Felix Queißner, qemu-devel; +Cc: kraxel, Igor Sudarikov

On 23/06/2022 16.59, Thomas Huth wrote:
> On 23/06/2022 16.36, Felix Queißner wrote:
>> Heya!
>>
>>> 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.
>>
>> It's been a while now, but i was always missing this feature in QEMU and 
>> i'd love to see that patch land in QEMU one day.
>>
>> I discovered that patch by searching for "start qemu with tabs visible" 
>> and found this link:
>>
>> https://patchwork.ozlabs.org/project/qemu-devel/patch/56D0203F.5060303@gmail.com/ 
> 
> 
> Not sure why it was

I wanted to say: "Not sure why it was never picked up"... sorry, I hit the 
send button by accident too early.

  Thomas




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

* Re: [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option.
  2022-06-23 14:59   ` Thomas Huth
  2022-06-23 15:00     ` Thomas Huth
@ 2022-06-23 15:05     ` Felix Queißner
  2022-06-23 15:18       ` Thomas Huth
  1 sibling, 1 reply; 6+ messages in thread
From: Felix Queißner @ 2022-06-23 15:05 UTC (permalink / raw)
  To: qemu-devel


> Not sure why it was never picked up
> 
> That patch certainly needs a re-spin since it won't apply as-is anymore. 
> Want to have a try?

I guess the semantics of the code stay the same, but the boilerplate 
might change a bit?

If so, i guess i can give it a try tomorrow and see if i can make it work.

- Felix



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

* Re: [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option.
  2022-06-23 15:05     ` Felix Queißner
@ 2022-06-23 15:18       ` Thomas Huth
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2022-06-23 15:18 UTC (permalink / raw)
  To: Felix Queißner, qemu-devel; +Cc: Gerd Hoffmann

On 23/06/2022 17.05, Felix Queißner wrote:
> 
>> Not sure why it was never picked up
>>
>> That patch certainly needs a re-spin since it won't apply as-is anymore. 
>> Want to have a try?
> 
> I guess the semantics of the code stay the same, but the boilerplate might 
> change a bit?
> 
> If so, i guess i can give it a try tomorrow and see if i can make it work.

The part that affects vl.c has changed completely - you now have to declare 
it in the "QAPI schema" in the file qapi/ui.json instead (and it has to use 
"-" instead of "_" now).

Just have a look how grab_on_hover is handled nowadays, then you'll should 
be able to figure it out, I think.

  HTH,
   Thomas



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

end of thread, other threads:[~2022-06-23 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-26  9:51 [Qemu-devel] [PATCH] gtk: Add show_tabs=on|off command line option Igor S
2022-06-23 14:36 ` Felix Queißner
2022-06-23 14:59   ` Thomas Huth
2022-06-23 15:00     ` Thomas Huth
2022-06-23 15:05     ` Felix Queißner
2022-06-23 15:18       ` 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).