key.c: fix unguarded else ifs for virt switching
This commit is contained in:
parent
22f9147cab
commit
ae87896421
1 changed files with 5 additions and 3 deletions
8
key.c
8
key.c
|
@ -538,7 +538,7 @@ void keypress(XKeyEvent* e) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* center snap */
|
/* center snap */
|
||||||
#ifdef CENTERSNAP_KEY
|
#ifdef SNAPCENTER_KEY
|
||||||
else if (e->keycode == ccode && (e->state & SHORTCUTMOD) == (MODBITS)) {
|
else if (e->keycode == ccode && (e->state & SHORTCUTMOD) == (MODBITS)) {
|
||||||
if ((e->state & ShiftMask) == (1 << 0)) {
|
if ((e->state & ShiftMask) == (1 << 0)) {
|
||||||
#ifdef CENTERVMAX
|
#ifdef CENTERVMAX
|
||||||
|
@ -590,21 +590,23 @@ void keypress(XKeyEvent* e) {
|
||||||
|
|
||||||
/* switch virts */
|
/* switch virts */
|
||||||
#ifdef NEXTVIRT_KEY
|
#ifdef NEXTVIRT_KEY
|
||||||
else if (e->keycode == rightcode && (e->state & SHORTCUTMOD) == (MODBITS))
|
else if (e->keycode == rightcode && (e->state & SHORTCUTMOD) == (MODBITS)) {
|
||||||
if (numvirtuals > 1)
|
if (numvirtuals > 1)
|
||||||
if (virt < numvirtuals - 1)
|
if (virt < numvirtuals - 1)
|
||||||
switch_to(virt + 1);
|
switch_to(virt + 1);
|
||||||
else
|
else
|
||||||
switch_to(0);
|
switch_to(0);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PREVVIRT_KEY
|
#ifdef PREVVIRT_KEY
|
||||||
else if (e->keycode == leftcode && (e->state & SHORTCUTMOD) == (MODBITS))
|
else if (e->keycode == leftcode && (e->state & SHORTCUTMOD) == (MODBITS)) {
|
||||||
if (numvirtuals > 1)
|
if (numvirtuals > 1)
|
||||||
if (virt > 0)
|
if (virt > 0)
|
||||||
switch_to(virt - 1);
|
switch_to(virt - 1);
|
||||||
else
|
else
|
||||||
switch_to(numvirtuals - 1);
|
switch_to(numvirtuals - 1);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XAllowEvents(dpy, SyncKeyboard, e->time);
|
XAllowEvents(dpy, SyncKeyboard, e->time);
|
||||||
|
|
Loading…
Reference in a new issue