summaryrefslogtreecommitdiff
path: root/src/key.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-03-12 13:11:40 -0700
committerVito Caputo <vcaputo@gnugeneration.com>2017-03-14 19:41:48 -0700
commitbc04055653fe64c4e8e109beedf96dd608007a3b (patch)
treeaaf60b45a56f9d5765f6dcf6afa89bd62b9d46e2 /src/key.c
parent2373a54d2d52961a841dace71b505d2c20f5c040 (diff)
*: trivial code formatting cleanups
I'm no longer fond of combining one-line conditional statements on the same line as their conditional expression.
Diffstat (limited to 'src/key.c')
-rw-r--r--src/key.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/key.c b/src/key.c
index 1b3000e..3f783e5 100644
--- a/src/key.c
+++ b/src/key.c
@@ -31,14 +31,16 @@
static int key_is_grabbed; /* flag for tracking keyboard grab state */
/* Poll the keyboard state to see if _any_ keys are pressed */
-static int keys_pressed(vwm_t *vwm) {
+static int keys_pressed(vwm_t *vwm)
+{
int i;
char state[32];
XQueryKeymap(VWM_XDISPLAY(vwm), state);
for (i = 0; i < sizeof(state); i++) {
- if (state[i]) return 1;
+ if (state[i])
+ return 1;
}
return 0;
@@ -67,10 +69,12 @@ void vwm_key_released(vwm_t *vwm, Window win, XKeyReleasedEvent *keyrelease)
}
/* make the focused window the most recently used */
- if ((vwin = vwm_win_focused(vwm))) vwm_win_mru(vwm, vwin);
+ if ((vwin = vwm_win_focused(vwm)))
+ vwm_win_mru(vwm, vwin);
/* make the focused desktop the most recently used */
- if (vwm->focused_context == VWM_CONTEXT_DESKTOP && vwm->focused_desktop) vwm_desktop_mru(vwm, vwm->focused_desktop);
+ if (vwm->focused_context == VWM_CONTEXT_DESKTOP && vwm->focused_desktop)
+ vwm_desktop_mru(vwm, vwm->focused_desktop);
break;
@@ -122,7 +126,9 @@ void vwm_key_pressed(vwm_t *vwm, Window win, XKeyPressedEvent *keypress)
#undef launcher
case XK_Alt_L: /* transaction abort */
case XK_Alt_R:
- if (key_is_grabbed) key_is_grabbed++;
+ if (key_is_grabbed)
+ key_is_grabbed++;
+
VWM_TRACE("aborting with origin %p", vwm->focused_origin);
break;
@@ -150,7 +156,8 @@ void vwm_key_pressed(vwm_t *vwm, Window win, XKeyPressedEvent *keypress)
if (keypress->state & ShiftMask) {
/* migrate the focused window with the desktop focus to the most recently used desktop */
- if (vwin) vwm_win_migrate(vwm, vwin, next_desktop);
+ if (vwin)
+ vwm_win_migrate(vwm, vwin, next_desktop);
} else {
vwm_desktop_focus(vwm, next_desktop);
}
@@ -291,7 +298,9 @@ void vwm_key_pressed(vwm_t *vwm, Window win, XKeyPressedEvent *keypress)
break;
case XK_s: /* shelve focused window */
- if (vwin && !vwin->shelved) vwm_win_shelve(vwm, vwin);
+ if (vwin && !vwin->shelved)
+ vwm_win_shelve(vwm, vwin);
+
break;
case XK_bracketleft: /* reconfigure the focused window to occupy the left or top half of the screen or left quarters on repeat */
© All Rights Reserved