sxhkd-rc

[fork] simple X hotkey daemon (but for the rc shell)
Log | Files | Refs | README | LICENSE

commit daa20c07ec902be6478cd11c95a93d224da8d0ed
parent 0996be85a93e2712cc0c7e289f4477f1a276f197
Author: Bastien Dejean <nihilhill@gmail.com>
Date:   Wed,  2 Oct 2013 21:18:20 +0200

Filter out irrelevant mapping notify events

Diffstat:
Msxhkd.c | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/sxhkd.c b/sxhkd.c @@ -243,12 +243,15 @@ void mapping_notify(xcb_generic_event_t *evt) if (ignore_mapping || !running || chained) return; xcb_mapping_notify_event_t *e = (xcb_mapping_notify_event_t *) evt; + if (e->request == XCB_MAPPING_POINTER) + return; PRINTF("mapping notify %u %u\n", e->request, e->count); - xcb_refresh_keyboard_mapping(symbols, e); - destroy_chord(escape_chord); - get_lock_fields(); - reload_cmd(); - escape_chord = make_chord(ESCAPE_KEYSYM, XCB_NONE, 0, XCB_KEY_PRESS, false, false); + if (xcb_refresh_keyboard_mapping(symbols, e) == 1) { + destroy_chord(escape_chord); + get_lock_fields(); + reload_cmd(); + escape_chord = make_chord(ESCAPE_KEYSYM, XCB_NONE, 0, XCB_KEY_PRESS, false, false); + } } void setup(void)