[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [PATCHv3 virt-viewer 11/12] kiosk: don't open extra monitors



In kiosk mode, we don't want new monitors windows that wouldn't fit on
the client monitors to come up.
---
 src/virt-viewer-app.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 4021148..5f65ec3 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -738,8 +738,17 @@ virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED,
     if (nth == 0) {
         window = priv->main_window;
     } else {
-        g_return_if_fail(virt_viewer_app_get_nth_window(self, nth) == NULL);
-        window = virt_viewer_app_window_new(self, nth);
+        window = virt_viewer_app_get_nth_window(self, nth);
+        if (window == NULL) {
+            if (priv->kiosk) {
+                /* don't show extra monitors that don't fit on client */
+                g_debug("kiosk mode: skip extra monitors that don't fit on client");
+                g_object_unref(display);
+                return;
+            }
+
+            window = virt_viewer_app_window_new(self, nth);
+        }
     }
 
     virt_viewer_window_set_display(window, display);
-- 
1.8.3.rc1.49.g8d97506


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]