[virt-tools-list] [PATCH virt-viewer 2/2] Don't create new windows at startup when kiosk mode is false

Jonathon Jongsma jjongsma at redhat.com
Thu Mar 6 22:17:34 UTC 2014


virt_viewer_app_set_kiosk creates a new window at startup for each client
monitor (regardless of whether the guest supports more than one display).  This
seems unnecessary.  Only do this if kiosk mode is actually enabled.
---
 src/virt-viewer-app.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 484762e..877917e 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1387,8 +1387,10 @@ virt_viewer_app_set_kiosk(VirtViewerApp *self, gboolean enabled)
     int i;
 
     self->priv->kiosk = enabled;
-    if (enabled)
-        virt_viewer_app_set_fullscreen(self, enabled);
+    if (!enabled)
+        return;
+
+    virt_viewer_app_set_fullscreen(self, enabled);
 
     for (i = 0; i < gdk_screen_get_n_monitors(gdk_screen_get_default()); i++) {
         VirtViewerWindow *win = virt_viewer_app_get_nth_window(self, i);
@@ -1396,9 +1398,7 @@ virt_viewer_app_set_kiosk(VirtViewerApp *self, gboolean enabled)
         if (win == NULL)
             win = virt_viewer_app_window_new(self, i);
 
-        if (enabled)
-            virt_viewer_window_show(win);
-
+        virt_viewer_window_show(win);
         virt_viewer_window_set_kiosk(win, enabled);
     }
 }
-- 
1.8.5.3




More information about the virt-tools-list mailing list