Skip to content

Commit 1bc78e7

Browse files
Issue 1399: fix floating window bug
1 parent 5d700bb commit 1bc78e7

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
@@ -231,13 +231,13 @@ std::tuple<std::size_t, int, int, std::string, std::string, std::string> gfnWith
231231

232232
// iterate
233233
auto [nb, f, id, name, app_id, workspace_layout] = gfnWithWorkspace(node["nodes"], output, config_, bar_, parentWorkspace, filterWorkspace, node["type"].asString());
234-
if (id > -1 && !name.empty()) {
234+
auto [nb2, f2, id2, name2, app_id2, workspace_layout2] = gfnWithWorkspace(node["floating_nodes"], output, config_, bar_, parentWorkspace, filterWorkspace, node["type"].asString());
235+
236+
if ((id > 0 || ((id2 < 0 || name2.empty()) && id > -1)) && !name.empty()) {
235237
return {nb, f, id, name, app_id, workspace_layout};
236238
}
237-
// Search for floating node
238-
std::tie(nb, f, id, name, app_id, workspace_layout) = gfnWithWorkspace(node["floating_nodes"], output, config_, bar_, parentWorkspace, filterWorkspace, node["type"].asString());
239-
if (id > -1 && !name.empty()) {
240-
return {nb, f, id, name, app_id,workspace_layout};
239+
else if (id2 > 0 && !name2.empty()) {
240+
return {nb2, f2, id2, name2, app_id2,workspace_layout2};
241241
}
242242
}
243243
/* "parentType" might be a bit misleading, it's the parent of the nodes being iterated in the loop above.

0 commit comments

Comments
 (0)