gtk: menubar visible in fullscreen mode with gtk3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned | ||
ubuntu-gnome3-desktop (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Using the gtk UI, compiled with gtk3, the menu bar is fully visible in full screen mode. On gtk2 it's hidden. The set_size_request call isn't abided on gtk3 it seems.
Simple fix is:
diff --git a/ui/gtk.c b/ui/gtk.c
index 66e886f..7b3bd3d 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -805,7 +805,7 @@ static void gd_menu_
if (!s->full_screen) {
- gtk_widget_
+ gtk_widget_
if (gd_on_vga(s)) {
@@ -815,7 +815,7 @@ static void gd_menu_
} else {
- gtk_widget_
+ gtk_widget_
The problem with that is that hiding the menu bar means all its associated accelerators are no longer usable, so there's way to exit fullscreen mode. That's kind of a problem :)
We can install the accelerators on the window, but make sure the menu item still shows the accelerator short cut. Example with the fullscreen accelerator:
diff --git a/ui/gtk.c b/ui/gtk.c
index 66e886f..fbce2b0 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -799,7 +799,7 @@ static void gd_menu_
}
}
-static void gd_menu_
+static void gd_do_full_
{
GtkDisplay
@@ -828,6 +828,11 @@ static void gd_menu_
gd_
}
+static void gd_menu_
+{
+ gd_do_full_
+}
+
static void gd_menu_
{
GtkDisplay
@@ -1304,10 +1309,11 @@ static GtkWidget *gd_create_
gtk_
s-
- gtk_menu_
- "<QEMU>/View/Full Screen");
- gtk_accel_
- HOTKEY_MODIFIERS);
+ gtk_accel_
+ g_cclosure_
+ gtk_accel_
+ GTK_ACCEL_
+ GDK_KEY_f, HOTKEY_MODIFIERS);
gtk_
separator = gtk_separator_
However gtk_accel_
For what it's worth, Gerd replied on the list that
> Patch trades one bug for another. Hiding the menu bar also kills the
> accelerator keys, which is especially problematic for the fullscreen
> hotkey as there is no way out of fullscreen mode then.