aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-08-21 12:41:54 -0700
committertaiyu <taiyu.len@gmail.com>2015-08-21 12:41:54 -0700
commitb05317c3a60c751ee4fbc596182b02f568b71c2e (patch)
tree03225a0c3680eba06f2c544a9e753a0e5aa58f1d
parentde5196dc1e6427d76d93d9cafe147fedbffbaad4 (diff)
style
-rw-r--r--sway/container.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/sway/container.c b/sway/container.c
index e6645fd2..62ff1c4a 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -341,7 +341,7 @@ swayc_t *swayc_parent_by_type(swayc_t *container, enum swayc_types type) {
}
do {
container = container->parent;
- } while(container && container->type != type);
+ } while (container && container->type != type);
return container;
}
@@ -402,18 +402,23 @@ swayc_t *swayc_active_workspace(void) {
}
swayc_t *swayc_active_workspace_for(swayc_t *cont) {
- if (! cont) {
+ if (!cont) {
return NULL;
}
switch (cont->type) {
- /* set root -> output */
- case C_ROOT: cont = cont->focused;
- /* set output -> workspace */
- case C_OUTPUT: cont = cont->focused;
- /* return workspace */
- case C_WORKSPACE: return cont;
- /* Find parent workspace */
- default: return swayc_parent_by_type(cont, C_WORKSPACE);
+ case C_ROOT:
+ cont = cont->focused;
+ /* Fallthrough */
+
+ case C_OUTPUT:
+ cont = cont->focused;
+ /* Fallthrough */
+
+ case C_WORKSPACE:
+ return cont;
+
+ default:
+ return swayc_parent_by_type(cont, C_WORKSPACE);
}
}