1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-04-17 21:53:36 +02:00

swpanel: Factor out if (swpanel) test

We can remove redundand tests in each "case:" inside the
switch if we do it in the beginning.
This commit is contained in:
Carlos R. Mafra
2009-08-22 02:55:45 +02:00
parent 203eba8937
commit 001bc28037

View File

@@ -142,13 +142,12 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next)
/* ignore CapsLock */ /* ignore CapsLock */
modifiers = ev.xkey.state & ValidModMask; modifiers = ev.xkey.state & ValidModMask;
switch (ev.type) { if (!swpanel)
case KeyPress:
if (!swpanel) {
done = True; done = True;
break;
} switch (ev.type) {
case KeyPress:
if ((wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode if ((wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers) && wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers)
@@ -197,19 +196,20 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next)
break; break;
case EnterNotify: case EnterNotify:
/* ignore unwanted EnterNotify's */ /* ignore unwanted EnterNotify's */
break; break;
case LeaveNotify: case LeaveNotify:
case MotionNotify: case MotionNotify:
case ButtonRelease: case ButtonRelease:
if (swpanel) {
newFocused = wSwitchPanelHandleEvent(swpanel, &ev); newFocused = wSwitchPanelHandleEvent(swpanel, &ev);
oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr); oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr);
if (ev.type == ButtonRelease) if (ev.type == ButtonRelease)
done = True; done = True;
}
break; break;
default: default: