* __i3_scratch will live there.
*
*/
-static Con *_create___i3() {
+static Con *_create___i3(void) {
Con *__i3 = con_new(croot, NULL);
FREE(__i3->name);
__i3->name = sstrdup("__i3");
}
Con *parent = con->parent;
+
+ /* Force re-rendering to make the indicator border visible. */
+ FREE(con->deco_render_params);
+ FREE(parent->deco_render_params);
+
/* if we are in a container whose parent contains only one
* child (its split functionality is unused so far), we just change the
* orientation (more intuitive than splitting again) */
- if (con_num_children(parent) == 1) {
+ if (con_num_children(parent) == 1 &&
+ parent->layout == L_DEFAULT) {
parent->orientation = orientation;
DLOG("Just changing orientation of existing container\n");
return;
}
/*
- * Moves focus one level up.
+ * Moves focus one level up. Returns true if focus changed.
*
*/
-void level_up() {
- /* We cannot go up when we are in fullscreen mode at the moment, that would
- * be totally not intuitive */
- if (focused->fullscreen_mode != CF_NONE) {
- LOG("Currently in fullscreen, not going up\n");
- return;
- }
+bool level_up(void) {
/* We can focus up to the workspace, but not any higher in the tree */
if ((focused->parent->type != CT_CON &&
focused->parent->type != CT_WORKSPACE) ||
focused->type == CT_WORKSPACE) {
LOG("Cannot go up any further\n");
- return;
+ return false;
}
con_focus(focused->parent);
+ return true;
}
/*
- * Moves focus one level down.
+ * Moves focus one level down. Returns true if focus changed.
*
*/
-void level_down() {
+bool level_down(void) {
/* Go down the focus stack of the current node */
Con *next = TAILQ_FIRST(&(focused->focus_head));
if (next == TAILQ_END(&(focused->focus_head))) {
printf("cannot go down\n");
- return;
+ return false;
}
con_focus(next);
+ return true;
}
static void mark_unmapped(Con *con) {
* pushing the changes to X11 using x_push_changes().
*
*/
-void tree_render() {
+void tree_render(void) {
if (croot == NULL)
return;
else next = TAILQ_LAST(&(parent->nodes_head), nodes_head);
}
+ /* Don't violate fullscreen focus restrictions. */
+ if (!con_fullscreen_permits_focusing(next))
+ return false;
+
/* 3: focus choice comes in here. at the moment we will go down
* until we find a window */
/* TODO: check for window, atm we only go down as far as possible */