move con_focus to con.c
This commit is contained in:
18
src/con.c
18
src/con.c
@ -74,6 +74,24 @@ void con_detach(Con *con) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Sets input focus to the given container. Will be updated in X11 in the next
|
||||
* run of x_push_changes().
|
||||
*
|
||||
*/
|
||||
void con_focus(Con *con) {
|
||||
assert(con != NULL);
|
||||
|
||||
/* 1: set focused-pointer to the new con */
|
||||
/* 2: exchange the position of the container in focus stack of the parent all the way up */
|
||||
TAILQ_REMOVE(&(con->parent->focus_head), con, focused);
|
||||
TAILQ_INSERT_HEAD(&(con->parent->focus_head), con, focused);
|
||||
if (con->parent->parent != NULL)
|
||||
con_focus(con->parent);
|
||||
|
||||
focused = con;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true when this node is a leaf node (has no children)
|
||||
*
|
||||
|
Reference in New Issue
Block a user