[virt-tools-list] [PATCHv2 virt-viewer 06/10] kiosk: teach a window to become kiosk-mode

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


Remove the toolbar, disable modifiers.
---
 src/virt-viewer-window.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 74c020a..abd417b 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -1260,6 +1260,23 @@ virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *displa
     }
 }
 
+static void
+virt_viewer_window_enable_kiosk(VirtViewerWindow *self)
+{
+    VirtViewerWindowPrivate *priv;
+
+    g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self));
+    priv = self->priv;
+
+    ViewOvBox_SetOver(VIEW_OV_BOX(priv->layout), gtk_drawing_area_new());
+    ViewAutoDrawer_SetActive(VIEW_AUTODRAWER(priv->layout), FALSE);
+    ViewAutoDrawer_SetOverlapPixels(VIEW_AUTODRAWER(priv->layout), 0);
+
+    /* You probably also want X11 Option "DontVTSwitch" "true" */
+    /* and perhaps more distro/desktop-specific options */
+    virt_viewer_window_disable_modifiers(self);
+}
+
 void
 virt_viewer_window_show(VirtViewerWindow *self)
 {
@@ -1273,6 +1290,9 @@ virt_viewer_window_show(VirtViewerWindow *self)
         self->priv->desktop_resize_pending = FALSE;
     }
 
+    if (self->priv->kiosk)
+        virt_viewer_window_enable_kiosk(self);
+
     virt_viewer_window_move_to_monitor(self);
 }
 
-- 
1.8.3.rc1.49.g8d97506




More information about the virt-tools-list mailing list