diff options
author | Nick Schermer <nick@xfce.org> | 2011-02-23 22:26:42 +0100 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2011-02-28 17:10:36 +0100 |
commit | 439a2674bdd2486776467dc8a1f7da097db03341 (patch) | |
tree | 3219215f070d1ab4ea36e5d0084198da4a136fda /xfsettingsd/keyboards.c | |
parent | 73e04c6fbde03b1103315a1df3304199670ec0bd (diff) | |
download | xfce4-settings-439a2674bdd2486776467dc8a1f7da097db03341.tar.gz |
Add debugging to keyboards object.
Diffstat (limited to 'xfsettingsd/keyboards.c')
-rw-r--r-- | xfsettingsd/keyboards.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/xfsettingsd/keyboards.c b/xfsettingsd/keyboards.c index 2fe0fbf9..f29220d2 100644 --- a/xfsettingsd/keyboards.c +++ b/xfsettingsd/keyboards.c @@ -41,6 +41,7 @@ #include <xfconf/xfconf.h> #include <libxfce4util/libxfce4util.h> +#include "debug.h" #include "keyboards.h" @@ -92,17 +93,21 @@ static void xfce_keyboards_helper_init (XfceKeyboardsHelper *helper) { gint dummy; + gint marjor_ver, minor_ver; /* init */ helper->channel = NULL; - if (XkbQueryExtension (GDK_DISPLAY (), &dummy, &dummy, &dummy, &dummy, &dummy)) + if (XkbQueryExtension (GDK_DISPLAY (), &dummy, &dummy, &dummy, &marjor_ver, &minor_ver)) { + xfsettings_dbg (XFSD_DEBUG_KEYBOARDS, "initialized xkb %d.%d", marjor_ver, minor_ver); + /* open the channel */ helper->channel = xfconf_channel_get ("keyboards"); /* monitor channel changes */ - g_signal_connect (G_OBJECT (helper->channel), "property-changed", G_CALLBACK (xfce_keyboards_helper_channel_property_changed), helper); + g_signal_connect (G_OBJECT (helper->channel), "property-changed", + G_CALLBACK (xfce_keyboards_helper_channel_property_changed), helper); /* load settings */ xfce_keyboards_helper_set_auto_repeat_mode (helper); @@ -146,10 +151,10 @@ xfce_keyboards_helper_set_auto_repeat_mode (XfceKeyboardsHelper *helper) /* set key repeat */ values.auto_repeat_mode = repeat ? 1 : 0; - - /* set key repeat */ XChangeKeyboardControl (GDK_DISPLAY (), KBAutoRepeatMode, &values); + xfsettings_dbg (XFSD_DEBUG_KEYBOARDS, "set auto repeat %s", repeat ? "on" : "off"); + /* flush and remove the x error trap */ gdk_flush (); gdk_error_trap_pop (); @@ -185,6 +190,9 @@ xfce_keyboards_helper_set_repeat_rate (XfceKeyboardsHelper *helper) /* set updated controls */ XkbSetControls (GDK_DISPLAY (), XkbRepeatKeysMask, xkb); + xfsettings_dbg (XFSD_DEBUG_KEYBOARDS, "set key repeat (delay=%d, rate=%d)", + xkb->ctrls->repeat_delay, xkb->ctrls->repeat_interval); + /* cleanup */ XkbFreeControls (xkb, XkbRepeatKeysMask, True); XFree (xkb); @@ -233,6 +241,8 @@ xfce_keyboards_helper_restore_numlock_state (XfconfChannel *channel) numlock_mask = XkbKeysymToModifiers (dpy, XK_Num_Lock); XkbLockModifiers (dpy, XkbUseCoreKbd, numlock_mask, state ? numlock_mask : 0); + + xfsettings_dbg (XFSD_DEBUG_KEYBOARDS, "set numlock %s", state ? "on" : "off"); } |