Merge branch 'fix-focus-parent'
This commit is contained in:
commit
0b7e6d44b3
|
@ -68,6 +68,12 @@ bool con_is_floating(Con *con);
|
||||||
*/
|
*/
|
||||||
Con *con_inside_floating(Con *con);
|
Con *con_inside_floating(Con *con);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the given container is inside a focused container.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Con *con_inside_focused(Con *con);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the container with the given client window ID or NULL if no such
|
* Returns the container with the given client window ID or NULL if no such
|
||||||
* container exists.
|
* container exists.
|
||||||
|
|
12
src/con.c
12
src/con.c
|
@ -358,6 +358,18 @@ Con *con_inside_floating(Con *con) {
|
||||||
return con_inside_floating(con->parent);
|
return con_inside_floating(con->parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Checks if the given container is inside a focused container.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Con *con_inside_focused(Con *con) {
|
||||||
|
if (con == focused)
|
||||||
|
return true;
|
||||||
|
if (!con->parent)
|
||||||
|
return false;
|
||||||
|
return con_inside_focused(con->parent);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns the container with the given client window ID or NULL if no such
|
* Returns the container with the given client window ID or NULL if no such
|
||||||
* container exists.
|
* container exists.
|
||||||
|
|
2
src/x.c
2
src/x.c
|
@ -290,7 +290,7 @@ void x_draw_decoration(Con *con) {
|
||||||
/* find out which colors to use */
|
/* find out which colors to use */
|
||||||
if (con->urgent)
|
if (con->urgent)
|
||||||
p->color = &config.client.urgent;
|
p->color = &config.client.urgent;
|
||||||
else if (con == focused)
|
else if (con == focused || con_inside_focused(con))
|
||||||
p->color = &config.client.focused;
|
p->color = &config.client.focused;
|
||||||
else if (con == TAILQ_FIRST(&(parent->focus_head)))
|
else if (con == TAILQ_FIRST(&(parent->focus_head)))
|
||||||
p->color = &config.client.focused_inactive;
|
p->color = &config.client.focused_inactive;
|
||||||
|
|
Loading…
Reference in New Issue