From 0d66ba5735d8aa70242f69dbea7406ce52bc5961 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Fri, 4 Jul 2014 23:28:42 +0200 Subject: [PATCH] wmaker: simplify the code for the Xkb event handler The code uses an extra variable that is specific the the Xkb code but it is not really needed, removing it makes the code simpler, thus easier to maintain. Signed-off-by: Christophe CURIS --- src/event.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/event.c b/src/event.c index ac69102b..9757dadc 100644 --- a/src/event.c +++ b/src/event.c @@ -108,7 +108,7 @@ static void handleShapeNotify(XEvent *event); #endif #ifdef KEEP_XKB_LOCK_STATUS -static void handleXkbIndicatorStateNotify(XEvent *event); +static void handleXkbIndicatorStateNotify(XkbEvent *event); #endif /* real dead process handler */ @@ -544,18 +544,14 @@ static int matchWindow(const void *item, const void *cdata) static void handleExtensions(XEvent * event) { -#ifdef KEEP_XKB_LOCK_STATUS - XkbEvent *xkbevent; - xkbevent = (XkbEvent *) event; -#endif /*KEEP_XKB_LOCK_STATUS */ #ifdef USE_XSHAPE if (w_global.xext.shape.supported && event->type == (w_global.xext.shape.event_base + ShapeNotify)) { handleShapeNotify(event); } #endif #ifdef KEEP_XKB_LOCK_STATUS - if (wPreferences.modelock && (xkbevent->type == w_global.xext.xkb.event_base)) { - handleXkbIndicatorStateNotify(event); + if (wPreferences.modelock && (event->type == w_global.xext.xkb.event_base)) { + handleXkbIndicatorStateNotify((XkbEvent *) event); } #endif /*KEEP_XKB_LOCK_STATUS */ #ifdef USE_RANDR @@ -1188,7 +1184,7 @@ static void handleShapeNotify(XEvent * event) #ifdef KEEP_XKB_LOCK_STATUS /* please help ]d if you know what to do */ -static void handleXkbIndicatorStateNotify(XEvent *event) +static void handleXkbIndicatorStateNotify(XkbEvent *event) { WWindow *wwin; WScreen *scr; -- 2.11.4.GIT