[virt-tools-list] [PATCHv2 virt-viewer 03/10] kiosk: open a window on each client monitor

Marc-André Lureau marcandre.lureau at gmail.com
Fri Aug 16 19:47:39 UTC 2013


Open a window on each client monitor in fullscreen. If the remote
display has less monitors than the client, the extra client monitors
will still be used to prevent the user from accessing the windows or
desktop bellow, and also to show some status messages when necessary.
---
 src/virt-viewer-app.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 226e3fc..a38d9ab 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1262,7 +1262,22 @@ static void virt_viewer_app_usb_failed(VirtViewerSession *session G_GNUC_UNUSED,
 static void
 virt_viewer_app_set_kiosk(VirtViewerApp *self, gboolean enabled)
 {
+    int i;
+
     self->priv->kiosk = enabled;
+    virt_viewer_app_set_fullscreen(self, enabled);
+
+    if (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);
+
+            if (win == NULL)
+                win = virt_viewer_app_window_new(self, i);
+
+            virt_viewer_window_show(win);
+            virt_viewer_window_set_kiosk(win, enabled);
+        }
+    }
 }
 
 
-- 
1.8.3.rc1.49.g8d97506




More information about the virt-tools-list mailing list