summary refs log tree commit diff stats
path: root/ui/vnc.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-11-24 18:10:49 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-10 09:58:33 +0100
commit8cf364898cfe4ae761f2253e91a040633d6f87be (patch)
tree056bc466b445d527bda61b0021c63bf3d152f4b8 /ui/vnc.h
parente26437c2d4a7f6cbbc0bbd51b08a2dcce84bb93b (diff)
downloadfocaccia-qemu-8cf364898cfe4ae761f2253e91a040633d6f87be.tar.gz
focaccia-qemu-8cf364898cfe4ae761f2253e91a040633d6f87be.zip
vnc: implement shared flag handling.
VNC clients send a shared flag in the client init message.  Up to now
qemu completely ignores this.  This patch implements shared flag
handling.  It comes with three policies:  By default qemu behaves as one
would expect:  Asking for a exclusive access grants exclusive access to
the client connecting.  There is also a desktop sharing mode which
disallows exclusive connects (so one forgetting -shared wouldn't drop
everybody else) and a compatibility mode which mimics the traditional
(but non-conforming) qemu behavior.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/vnc.h')
-rw-r--r--ui/vnc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/vnc.h b/ui/vnc.h
index 66689f1d60..0bd1fc6d23 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -122,9 +122,24 @@ struct VncSurface
     DisplaySurface *ds;
 };
 
+typedef enum VncShareMode {
+    VNC_SHARE_MODE_CONNECTING = 1,
+    VNC_SHARE_MODE_SHARED,
+    VNC_SHARE_MODE_EXCLUSIVE,
+    VNC_SHARE_MODE_DISCONNECTED,
+} VncShareMode;
+
+typedef enum VncSharePolicy {
+    VNC_SHARE_POLICY_IGNORE = 1,
+    VNC_SHARE_POLICY_ALLOW_EXCLUSIVE,
+    VNC_SHARE_POLICY_FORCE_SHARED,
+} VncSharePolicy;
+
 struct VncDisplay
 {
     QTAILQ_HEAD(, VncState) clients;
+    int num_exclusive;
+    VncSharePolicy share_policy;
     QEMUTimer *timer;
     int timer_interval;
     int lsock;
@@ -250,6 +265,7 @@ struct VncState
     int last_y;
     int client_width;
     int client_height;
+    VncShareMode share_mode;
 
     uint32_t vnc_encoding;