Skip to content

Commit 793c990

Browse files
Issue 1399: fix floating window bug
1 parent 40eafc2 commit 793c990

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/modules/sway/window.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ std::tuple<std::size_t, int, int, std::string, std::string, std::string> gfnWith
174174

175175
// iterate
176176
auto [nb, f, id, name, app_id, workspace_layout] = gfnWithWorkspace(node["nodes"], output, config_, bar_, parentWorkspace, filterWorkspace, node["type"].asString());
177-
if (id > -1 && !name.empty()) {
177+
auto [nb2, f2, id2, name2, app_id2, workspace_layout2] = gfnWithWorkspace(node["floating_nodes"], output, config_, bar_, parentWorkspace, filterWorkspace, node["type"].asString());
178+
179+
if ((id > 0 || ((id2 < 0 || name2.empty()) && id > -1)) && !name.empty()) {
178180
return {nb, f, id, name, app_id, workspace_layout};
179181
}
180-
// Search for floating node
181-
std::tie(nb, f, id, name, app_id, workspace_layout) = gfnWithWorkspace(node["floating_nodes"], output, config_, bar_, parentWorkspace, filterWorkspace, node["type"].asString());
182-
if (id > -1 && !name.empty()) {
183-
return {nb, f, id, name, app_id,workspace_layout};
182+
else if (id2 > 0 && !name2.empty()) {
183+
return {nb2, f2, id2, name2, app_id2,workspace_layout2};
184184
}
185185
}
186186
/* "parentType" might be a bit misleading, it's the parent of the nodes being iterated in the loop above.

0 commit comments

Comments
 (0)