[Spice-devel] [spice-gtk 8/9] Add can_set_keyboard_lock_modifiers function

Frediano Ziglio fziglio at redhat.com
Wed Jun 8 11:10:33 UTC 2016


Allows to understand if we can set client modifiers

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/keyboard-modifiers.c | 13 +++++++++++++
 src/keyboard-modifiers.h |  1 +
 2 files changed, 14 insertions(+)

diff --git a/src/keyboard-modifiers.c b/src/keyboard-modifiers.c
index cb019c9..5bfbb14 100644
--- a/src/keyboard-modifiers.c
+++ b/src/keyboard-modifiers.c
@@ -162,6 +162,10 @@ void set_keyboard_lock_modifiers(guint32 modifiers)
     set_keyboard_led(x_display, SCROLL_LOCK_LED, !!(modifiers & SPICE_INPUTS_SCROLL_LOCK));
 }
 
+gboolean can_set_keyboard_lock_modifiers(void)
+{
+    return TRUE;
+}
 #elif defined(G_OS_WIN32)
 
 // Some definitions from kbd.h to define internal layout file structures
@@ -692,10 +696,19 @@ void set_keyboard_lock_modifiers(guint32 modifiers)
     }
 }
 
+gboolean can_set_keyboard_lock_modifiers(void)
+{
+    return TRUE;
+}
 #else
 
 void set_keyboard_lock_modifiers(guint32 modifiers)
 {
     g_warning("set_keyboard_lock_modifiers not implemented");
 }
+
+gboolean can_set_keyboard_lock_modifiers(void)
+{
+    return FALSE;
+}
 #endif
diff --git a/src/keyboard-modifiers.h b/src/keyboard-modifiers.h
index 016be84..c17cf82 100644
--- a/src/keyboard-modifiers.h
+++ b/src/keyboard-modifiers.h
@@ -28,6 +28,7 @@
 G_BEGIN_DECLS
 
 guint32 get_keyboard_lock_modifiers(void);
+gboolean can_set_keyboard_lock_modifiers(void);
 void set_keyboard_lock_modifiers(guint32 modifiers);
 
 G_END_DECLS
-- 
2.7.4



More information about the Spice-devel mailing list