mirror of
https://github.com/swaywm/sway.git
synced 2026-04-25 06:46:24 -04:00
tree/container: use L_NONE for parent layout of floating container
The parent of a floating container is technically the workspace, but it is incorrect to say that the parent layout of a floating container is that of the workspace. For instance, if the workspace layout is tabbed, a floating container should not (and does not) show tab decorations. However, prior to this commit, querying its parent layout would nonetheless return `L_TABBED`. Fixes #5782.
This commit is contained in:
parent
c523aa623b
commit
1c312c4ada
2 changed files with 7 additions and 2 deletions
|
|
@ -1225,12 +1225,18 @@ void container_discover_outputs(struct sway_container *con) {
|
|||
}
|
||||
|
||||
enum sway_container_layout container_parent_layout(struct sway_container *con) {
|
||||
if (container_is_floating(con)) {
|
||||
return L_NONE;
|
||||
}
|
||||
|
||||
if (con->parent) {
|
||||
return con->parent->layout;
|
||||
}
|
||||
|
||||
if (con->workspace) {
|
||||
return con->workspace->layout;
|
||||
}
|
||||
|
||||
return L_NONE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1258,8 +1258,7 @@ bool view_is_visible(struct sway_view *view) {
|
|||
struct sway_container *con = view->container;
|
||||
while (con) {
|
||||
enum sway_container_layout layout = container_parent_layout(con);
|
||||
if ((layout == L_TABBED || layout == L_STACKED)
|
||||
&& !container_is_floating(con)) {
|
||||
if (layout == L_TABBED || layout == L_STACKED) {
|
||||
struct sway_node *parent = con->parent ?
|
||||
&con->parent->node : &con->workspace->node;
|
||||
if (seat_get_active_tiling_child(seat, parent) != &con->node) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue