# HG changeset patch # User Anselm R.Garbe # Date 1155564532 -7200 # Node ID 2cedfbefd025d5b7fb4df57a4ed63d02dfc258e0 # Parent c1187ddcd7f771652fb9cb2d72d6d50f5b5357c7 added mappingnotify event for kb refreshes diff -r c1187ddcd7f7 -r 2cedfbefd025 event.c --- a/event.c Mon Aug 14 15:43:04 2006 +0200 +++ b/event.c Mon Aug 14 16:08:52 2006 +0200 @@ -277,6 +277,16 @@ } static void +mappingnotify(XEvent *e) +{ + XMappingEvent *ev = &e->xmapping; + + XRefreshKeyboardMapping(ev); + if(ev->request == MappingKeyboard) + grabkeys(); +} + +static void maprequest(XEvent *e) { static XWindowAttributes wa; @@ -348,6 +358,7 @@ [LeaveNotify] = leavenotify, [Expose] = expose, [KeyPress] = keypress, + [MappingNotify] = mappingnotify, [MapRequest] = maprequest, [PropertyNotify] = propertynotify, [UnmapNotify] = unmapnotify @@ -360,6 +371,7 @@ unsigned int i; KeyCode code; + XUngrabKey(dpy, AnyKey, AnyModifier, root); for(i = 0; i < len; i++) { code = XKeysymToKeycode(dpy, key[i].keysym); XGrabKey(dpy, code, key[i].mod, root, True,