[Spice-devel] [qemu-spice PATCH 1/2] spice: added interface for getting current mouse mode
yuri.benditovich at daynix.com
yuri.benditovich at daynix.com
Mon Nov 14 12:09:42 UTC 2016
From: Yuri Benditovich <yuri.benditovich at daynix.com>
QXL device will read current mouse mode upon indication
of mouse mode change.
Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
---
include/ui/qemu-spice.h | 14 ++++++++++++++
ui/spice-core.c | 5 +++++
2 files changed, 19 insertions(+)
diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h
index 75e1239..6018052 100644
--- a/include/ui/qemu-spice.h
+++ b/include/ui/qemu-spice.h
@@ -41,6 +41,7 @@ int qemu_spice_set_passwd(const char *passwd,
int qemu_spice_set_pw_expire(time_t expires);
int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
const char *subject);
+bool qemu_spice_is_server_mouse(void);
#if !defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06)
#define SPICE_NEEDS_SET_MM_TIME 1
@@ -48,6 +49,13 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
#define SPICE_NEEDS_SET_MM_TIME 0
#endif
+#if (SPICE_SERVER_VERSION >= 0x000d03) && \
+ defined(QXL_INTERRUPT_MOUSE_MODE_CHANGE)
+#define SPICE_MOUSE_MODE_CHANGE_SUPPORTED 1
+#else
+#define SPICE_MOUSE_MODE_CHANGE_SUPPORTED 0
+#endif
+
#if SPICE_SERVER_VERSION >= 0x000c02
void qemu_spice_register_ports(void);
#else
@@ -59,6 +67,7 @@ static inline CharDriverState *qemu_chr_open_spice_port(const char *name)
#include "qemu/error-report.h"
+#define SPICE_MOUSE_MODE_CHANGE_SUPPORTED 0
#define using_spice 0
#define spice_displays 0
static inline int qemu_spice_set_passwd(const char *passwd,
@@ -94,6 +103,11 @@ static inline void qemu_spice_init(void)
{
}
+bool qemu_spice_is_server_mouse(void)
+{
+ return true;
+}
+
#endif /* CONFIG_SPICE */
static inline bool qemu_using_spice(Error **errp)
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 1452e77..a65420e 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -922,6 +922,11 @@ int qemu_spice_set_pw_expire(time_t expires)
return qemu_spice_set_ticket(false, false);
}
+bool qemu_spice_is_server_mouse(void)
+{
+ return !spice_server || spice_server_is_server_mouse(spice_server);
+}
+
int qemu_spice_display_add_client(int csock, int skipauth, int tls)
{
if (tls) {
--
2.7.4
More information about the Spice-devel
mailing list