1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-24 07:02:30 +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 */
modifiers = ev.xkey.state & ValidModMask;
switch (ev.type) {
case KeyPress:
if (!swpanel)
done = True;
if (!swpanel) {
done = True;
break;
}
switch (ev.type) {
case KeyPress:
if ((wKeyBindings[WKBD_FOCUSNEXT].keycode == ev.xkey.keycode
&& wKeyBindings[WKBD_FOCUSNEXT].modifier == modifiers)
@@ -197,19 +196,20 @@ void StartWindozeCycle(WWindow * wwin, XEvent * event, Bool next)
break;
case EnterNotify:
/* ignore unwanted EnterNotify's */
break;
case LeaveNotify:
case MotionNotify:
case ButtonRelease:
if (swpanel) {
newFocused = wSwitchPanelHandleEvent(swpanel, &ev);
oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr);
if (ev.type == ButtonRelease)
done = True;
}
case ButtonRelease:
newFocused = wSwitchPanelHandleEvent(swpanel, &ev);
oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr);
if (ev.type == ButtonRelease)
done = True;
break;
default: