From 2bce79404ddd9f81f87e8a361a4701e46289a0e0 Mon Sep 17 00:00:00 2001 From: id Date: Sun, 23 May 1999 19:33:19 +0000 Subject: [PATCH] fixes relate modelock. --- src/def_pixmaps.h | 40 ++++++++++++++++++++-------------------- src/event.c | 13 +++++++------ src/screen.c | 11 +++++++++-- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/def_pixmaps.h b/src/def_pixmaps.h index 45cebd99..49e8f1f1 100644 --- a/src/def_pixmaps.h +++ b/src/def_pixmaps.h @@ -135,32 +135,32 @@ static char *PRED_XKBGROUP3_XPM[] = { " 10 10 2 1", ". c #000000", "# c None", -"##########", -"##########", -"##..##..##", -"##..##..##", -"##########", -"##########", -"#........#", -"##......##", -"###....###", -"##########" +"..........", +"..........", +"..##..##..", +"..##..##..", +"..........", +"..........", +"..######..", +"...####...", +"....##....", +".........." }; static char *PRED_XKBGROUP4_XPM[] = { " 10 10 2 1", ". c #000000", "# c None", -"##########", -"##########", -"##..##..##", -"##..##..##", -"##########", -"##########", -"#........#", -"##......##", -"###....###", -"##########" +"..........", +".########.", +".#..##..#.", +".#..##..#.", +".########.", +".#......#.", +".##....##.", +".###..###.", +".########.", +".........." }; #endif /* XKB_BUTTON_HINT */ diff --git a/src/event.c b/src/event.c index b470736a..798d6e78 100644 --- a/src/event.c +++ b/src/event.c @@ -96,6 +96,10 @@ extern Bool wShapeSupported; extern int wShapeEventBase; #endif +#ifdef KEEP_XKB_LOCK_STATUS +extern int wXkbEventBase; +#endif + /* special flags */ extern char WDelayedActionSet; @@ -447,18 +451,15 @@ static void handleExtensions(XEvent *event) { XkbEvent *xkbevent; - xkbevent = event; + xkbevent = (XkbEvent *)event; #ifdef SHAPE if (wShapeSupported && event->type == (wShapeEventBase+ShapeNotify)) { handleShapeNotify(event); } #endif #ifdef KEEP_XKB_LOCK_STATUS - if (wPreferences.modelock && - (event->type == 0x54)){ - /* if someone know how to call this 0x50 - * or how to clean code this please tell ]d */ - handleXkbIndicatorStateNotify(event); + if (wPreferences.modelock && (xkbevent->type == wXkbEventBase)){ + handleXkbIndicatorStateNotify(event); } #endif /*KEEP_XKB_LOCK_STATUS*/ } diff --git a/src/screen.c b/src/screen.c index ee287a14..7587f097 100644 --- a/src/screen.c +++ b/src/screen.c @@ -88,6 +88,10 @@ extern Atom _XA_WINDOWMAKER_NOTICEBOARD; extern int wScreenCount; +#ifdef KEEP_XKB_LOCK_STATUS +extern int wXkbSupported; +#endif + extern WDDomain *WDWindowMaker; @@ -713,8 +717,11 @@ wScreenInit(int screen_number) XSelectInput(dpy, scr->root_win, event_mask); #ifdef KEEP_XKB_LOCK_STATUS - XkbSelectEventDetails(dpy,XkbUseCoreKbd,XkbIndicatorStateNotify, - XkbIndicatorStateNotifyMask, XkbIndicatorStateNotifyMask); + if (wXkbSupported) { + XkbSelectEvents(dpy,XkbUseCoreKbd, + XkbStateNotifyMask, + XkbStateNotifyMask); + } #endif /* KEEP_XKB_LOCK_STATUS */ XSync(dpy, False); -- 2.11.4.GIT