[Spice-devel] [spice-server] Notify QXL instance upon change of mouse mode

yuri.benditovich at daynix.com yuri.benditovich at daynix.com
Mon Nov 14 12:09:40 UTC 2016


From: Yuri Benditovich <yuri.benditovich at daynix.com>

When mouse mode (client/server) changed, spice server
notifies QXL instance to allow QEMU to optimize cursor-related
traffic from guest to host.

Signed-off-by: Yuri Benditovich <Yuri Benditovich yuri.benditovich at daynix.com>
---
 server/red-qxl.c   | 4 ++++
 server/spice-qxl.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/server/red-qxl.c b/server/red-qxl.c
index 19cff95..744ff0c 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -1070,7 +1070,11 @@ void red_qxl_on_vc_change(QXLInstance *qxl, GArray *video_codecs)
 
 void red_qxl_set_mouse_mode(QXLInstance *qxl, uint32_t mode)
 {
+    QXLInterface *interface = qxl_get_interface(qxl);
     RedWorkerMessageSetMouseMode payload;
+    if (interface->mouse_mode_changed) {
+        interface->mouse_mode_changed(qxl);
+    }
     payload.mode = mode;
     dispatcher_send_message(qxl->st->dispatcher,
                             RED_WORKER_MESSAGE_SET_MOUSE_MODE,
diff --git a/server/spice-qxl.h b/server/spice-qxl.h
index b8910bf..a333cd8 100644
--- a/server/spice-qxl.h
+++ b/server/spice-qxl.h
@@ -205,6 +205,7 @@ struct QXLInterface {
      * return code. */
     int (*client_monitors_config)(QXLInstance *qin,
                                   VDAgentMonitorsConfig *monitors_config);
+    void (*mouse_mode_changed)(QXLInstance *qin);
 };
 
 struct QXLInstance {
-- 
2.7.4



More information about the Spice-devel mailing list