[PATCH xf86-video-qxl 2/4] Correct the XSpice AgentMouse configuration options.

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

 



Since the introduction of vdagent support in commit
294daff7ea930f338ec6d77ec3465b6f727c168e, the
SpiceAgentMouse setting has not really operated correctly.

That is, if SpiceVdagentEnabled was true, the value
of SpiceAgentMouse was overridden.

This patch corrects that, and also defers point where
we enable agent mouse mode to the point that we have
a connected agent.

It also shifts the default; that matches qemu, and effectively
preserves the current default behavior.

Signed-off-by: Jeremy White <jwhite@xxxxxxxxxxxxxxx>
---
 examples/spiceqxl.xorg.conf.example | 6 +++---
 src/qxl_driver.c                    | 2 +-
 src/spiceqxl_spice_server.c         | 4 ----
 src/spiceqxl_uinput.c               | 1 -
 src/spiceqxl_vdagent.c              | 4 ++++
 5 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/examples/spiceqxl.xorg.conf.example b/examples/spiceqxl.xorg.conf.example
index d15f7f2..9b223c8 100644
--- a/examples/spiceqxl.xorg.conf.example
+++ b/examples/spiceqxl.xorg.conf.example
@@ -126,9 +126,9 @@ Section "Device"
     # defaults to 16
     #Option "FrameBufferSize" "16"
 
-    # Set Spice Agent Mouse
-    # defaults to false
-    #Option "SpiceAgentMouse" "False"
+    # Set Spice Agent Mouse - Use Agent mouse if an agent connects
+    # defaults to true
+    #Option "SpiceAgentMouse" "True"
 
     # Set Spice Playback compression
     # defaults to true
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index ce0a88e..9f7d965 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -100,7 +100,7 @@ const OptionInfoRec DefaultOptions[] =
       "SpiceSasl",                OPTV_BOOLEAN,   {0}, FALSE},
     /* VVV qemu defaults to 1 - not implemented in xspice yet */
     { OPTION_SPICE_AGENT_MOUSE,
-      "SpiceAgentMouse",          OPTV_BOOLEAN,   {0}, FALSE},
+      "SpiceAgentMouse",          OPTV_BOOLEAN,   {0}, TRUE },
     { OPTION_SPICE_DISABLE_TICKETING,
       "SpiceDisableTicketing",    OPTV_BOOLEAN,   {0}, FALSE},
     { OPTION_SPICE_PASSWORD,
diff --git a/src/spiceqxl_spice_server.c b/src/spiceqxl_spice_server.c
index 26e7487..dd4fae1 100644
--- a/src/spiceqxl_spice_server.c
+++ b/src/spiceqxl_spice_server.c
@@ -173,9 +173,6 @@ void xspice_set_spice_server_options(OptionInfoPtr options)
     const char *streaming_video =
         get_str_option(options, OPTION_SPICE_STREAMING_VIDEO,
                        "XSPICE_STREAMING_VIDEO");
-    int agent_mouse =
-        get_bool_option(options, OPTION_SPICE_AGENT_MOUSE,
-                        "XSPICE_AGENT_MOUSE");
     int playback_compression =
         get_bool_option(options, OPTION_SPICE_PLAYBACK_COMPRESSION,
                         "XSPICE_PLAYBACK_COMPRESSION");
@@ -295,7 +292,6 @@ void xspice_set_spice_server_options(OptionInfoPtr options)
         spice_server_set_streaming_video(spice_server, streaming_video_opt);
     }
 
-    spice_server_set_agent_mouse(spice_server, agent_mouse);
     spice_server_set_playback_compression(spice_server, playback_compression);
 
     free(x509_key_file);
diff --git a/src/spiceqxl_uinput.c b/src/spiceqxl_uinput.c
index 1e61907..2d1b149 100644
--- a/src/spiceqxl_uinput.c
+++ b/src/spiceqxl_uinput.c
@@ -122,5 +122,4 @@ void spiceqxl_uinput_init(qxl_screen_t *qxl)
         return;
     }
     qxl->core->watch_add(uinput_fd, SPICE_WATCH_EVENT_READ, spiceqxl_uinput_read_cb, qxl);
-    spice_server_set_agent_mouse(qxl->spice_server, 1);
 }
diff --git a/src/spiceqxl_vdagent.c b/src/spiceqxl_vdagent.c
index 398c600..e20c0a5 100644
--- a/src/spiceqxl_vdagent.c
+++ b/src/spiceqxl_vdagent.c
@@ -121,6 +121,10 @@ static void on_accept(int fd, int event, void *opaque)
     }
     virtio_client_watch = qxl->core->watch_add(virtio_client_fd, SPICE_WATCH_EVENT_READ
         /* TODO - SPICE_WATCH_EVENT_WRITE */, on_read_available, qxl);
+
+    if (get_bool_option(qxl->options, OPTION_SPICE_AGENT_MOUSE, "XSPICE_AGENT_MOUSE"))
+        spice_server_set_agent_mouse(qxl->spice_server, 1);
+
     return;
 
 error:
-- 
2.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]