[virt-tools-list] [PATCH virt-viewer] Unset app 'fullscreen' when leaving fullscreen

Jonathon Jongsma jjongsma at redhat.com
Thu Sep 25 15:58:47 UTC 2014


Previously, the fullscreen floating toolbar and the "toggle-fullscreen"
hotkey (which maps to the menu item action) had slightly different
methods of exiting fullscreen. The floating toolbar method unset the
'fullscreen' property on the application (which causes all windows to
simultaneously exit fullscreen), whereas the hotkey did not. This had a
side-effect of preventing the display from auto re-sizing if it was
fullscreened again.  After this change, both the hotkey and the toolbar
button will unset the application-level 'fullscreen' property when
exiting fullscreen mode.

Resolves: rhbz#1022608
---
 src/virt-viewer-window.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index fa04a97..a9c9442 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -829,16 +829,26 @@ virt_viewer_window_menu_file_quit(GtkWidget *src G_GNUC_UNUSED,
 }
 
 
-static void
-virt_viewer_window_toolbar_leave_fullscreen(GtkWidget *button G_GNUC_UNUSED,
-                                            VirtViewerWindow *self)
+static void virt_viewer_window_set_fullscreen(VirtViewerWindow *self,
+                                              gboolean fullscreen)
 {
+    if (fullscreen) {
+        virt_viewer_window_enter_fullscreen(self, -1);
+    } else {
     /* leave all windows fullscreen state */
     if (virt_viewer_app_get_fullscreen(self->priv->app))
         g_object_set(self->priv->app, "fullscreen", FALSE, NULL);
     /* or just this window */
     else
         virt_viewer_window_leave_fullscreen(self);
+    }
+}
+
+static void
+virt_viewer_window_toolbar_leave_fullscreen(GtkWidget *button G_GNUC_UNUSED,
+                                            VirtViewerWindow *self)
+{
+    virt_viewer_window_set_fullscreen(self, FALSE);
 }
 
 static void keycombo_menu_location(GtkMenu *menu G_GNUC_UNUSED, gint *x, gint *y,
@@ -875,10 +885,7 @@ virt_viewer_window_menu_view_fullscreen(GtkWidget *menu,
 {
     gboolean fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu));
 
-    if (fullscreen)
-        virt_viewer_window_enter_fullscreen(self, -1);
-    else
-        virt_viewer_window_leave_fullscreen(self);
+    virt_viewer_window_set_fullscreen(self, fullscreen);
 }
 
 static void add_if_writable (GdkPixbufFormat *data, GHashTable *formats)
-- 
1.9.3




More information about the virt-tools-list mailing list