[gnome-settings-daemon] wacom: Avoid X errors when calling XTestFakeKeyEvent()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Avoid X errors when calling XTestFakeKeyEvent()
- Date: Wed, 11 Jul 2012 11:41:30 +0000 (UTC)
commit 67f96d467471428d43e5bb53daae29cdce0541a1
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jul 11 12:15:52 2012 +0100
wacom: Avoid X errors when calling XTestFakeKeyEvent()
https://bugzilla.gnome.org/show_bug.cgi?id=679736
plugins/wacom/gsd-wacom-manager.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 498364d..7cb62d8 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -1032,16 +1032,20 @@ generate_key (GsdWacomTabletButton *wbutton,
} else {
g_debug ("Emitting '%s' (keyval: %d, keycode: %d mods: 0x%x)",
str, keyval, keycode, mods);
- g_free (str);
}
/* And send out the keys! */
+ gdk_error_trap_push ();
if (is_press)
send_modifiers (display, mods, TRUE);
XTestFakeKeyEvent (display, keycode,
is_press ? True : False, 0);
if (is_press == FALSE)
send_modifiers (display, mods, FALSE);
+ if (gdk_error_trap_pop ())
+ g_warning ("Failed to generate fake key event '%s'", str);
+
+ g_free (str);
}
static GdkFilterReturn
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]