1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-16 23:43:32 +01: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: done = True;
if (!swpanel) { switch (ev.type) {
done = True;
break; 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:
if (swpanel) {
newFocused = wSwitchPanelHandleEvent(swpanel, &ev);
oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr);
if (ev.type == ButtonRelease) case ButtonRelease:
done = True;
} newFocused = wSwitchPanelHandleEvent(swpanel, &ev);
oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr);
if (ev.type == ButtonRelease)
done = True;
break; break;
default: default: