[Spice-devel] [spice-gtk v3 3/7] Avoid too much #ifdef inside set_keyboard_lock_modifiers functions

Frediano Ziglio fziglio at redhat.com
Sat Sep 3 16:10:03 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 src/spice-gtk-keyboard.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/spice-gtk-keyboard.c b/src/spice-gtk-keyboard.c
index af9c81e..6db53b4 100644
--- a/src/spice-gtk-keyboard.c
+++ b/src/spice-gtk-keyboard.c
@@ -140,11 +140,9 @@ static void set_keyboard_led(Display *x_display, SpiceLed led, int set)
         return;
     }
 }
-#endif
 
 void set_keyboard_lock_modifiers(guint32 modifiers)
 {
-#if defined(HAVE_X11_XKBLIB_H)
     Display *x_display;
 
     GdkScreen *screen = gdk_screen_get_default();
@@ -158,7 +156,12 @@ void set_keyboard_lock_modifiers(guint32 modifiers)
     set_keyboard_led(x_display, CAPS_LOCK_LED, !!(modifiers & SPICE_INPUTS_CAPS_LOCK));
     set_keyboard_led(x_display, NUM_LOCK_LED, !!(modifiers & SPICE_INPUTS_NUM_LOCK));
     set_keyboard_led(x_display, SCROLL_LOCK_LED, !!(modifiers & SPICE_INPUTS_SCROLL_LOCK));
+}
+
 #else
+
+void set_keyboard_lock_modifiers(guint32 modifiers)
+{
     g_warning("set_keyboard_lock_modifiers not implemented");
-#endif
 }
+#endif
-- 
2.7.4



More information about the Spice-devel mailing list