diff options
author | Nick Schermer <nick@xfce.org> | 2011-05-20 18:37:18 +0200 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2011-05-25 18:57:08 +0200 |
commit | ce7664a26755fc606039f6cbba515a0002f57ada (patch) | |
tree | e31ad63094bbe9e0f9134cfb58885a05f2228a59 /xfsettingsd/keyboards.c | |
parent | 95ee98c7055528a040cd71423389f98b4796d663 (diff) | |
download | xfce4-settings-ce7664a26755fc606039f6cbba515a0002f57ada.tar.gz |
Remove flush calls around error traps.
Diffstat (limited to 'xfsettingsd/keyboards.c')
-rw-r--r-- | xfsettingsd/keyboards.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/xfsettingsd/keyboards.c b/xfsettingsd/keyboards.c index f29220d2..f5c7edc7 100644 --- a/xfsettingsd/keyboards.c +++ b/xfsettingsd/keyboards.c @@ -145,19 +145,15 @@ xfce_keyboards_helper_set_auto_repeat_mode (XfceKeyboardsHelper *helper) /* load setting */ repeat = xfconf_channel_get_bool (helper->channel, "/Default/KeyRepeat", TRUE); - /* flush x and trap errors */ - gdk_flush (); - gdk_error_trap_push (); - /* set key repeat */ values.auto_repeat_mode = repeat ? 1 : 0; + + gdk_error_trap_push (); XChangeKeyboardControl (GDK_DISPLAY (), KBAutoRepeatMode, &values); + if (gdk_error_trap_pop () != 0) + g_critical ("Failed to change keyboard repeat mode"); 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 (); } @@ -172,8 +168,6 @@ xfce_keyboards_helper_set_repeat_rate (XfceKeyboardsHelper *helper) delay = xfconf_channel_get_int (helper->channel, "/Default/KeyRepeat/Delay", 500); rate = xfconf_channel_get_int (helper->channel, "/Default/KeyRepeat/Rate", 20); - /* flush x and trap errors */ - gdk_flush (); gdk_error_trap_push (); /* allocate xkb structure */ @@ -198,9 +192,8 @@ xfce_keyboards_helper_set_repeat_rate (XfceKeyboardsHelper *helper) XFree (xkb); } - /* flush and remove the x error trap */ - gdk_flush (); - gdk_error_trap_pop (); + if (gdk_error_trap_pop () != 0) + g_critical ("Failed to change the keyboard repeat"); } |