@@ -188,22 +188,18 @@ std::pair<int, int> leafNodesInWorkspace(const Json::Value& node) {
188
188
189
189
std::tuple<std::size_t , int , int , std::string, std::string, std::string> gfnWithWorkspace (
190
190
const Json::Value& nodes, std::string& output, const Json::Value& config_,
191
- const Bar& bar_, Json::Value& parentWorkspace, Json::Value& filterWorkspace, const Json::Value& immediateParent) {
191
+ const Bar& bar_, Json::Value& parentWorkspace, const Json::Value& immediateParent) {
192
192
bool found_visible = false ;
193
193
for (auto const & node : nodes) {
194
194
if (node[" type" ].asString () == " output" ) {
195
195
if (!config_[" all-outputs" ].asBool () && node[" name" ].asString () != bar_.output ->name ) {
196
196
continue ;
197
197
}
198
- filterWorkspace = node[" current_workspace" ];
199
198
output = node[" name" ].asString ();
200
199
}
201
200
else if (node[" type" ].asString () == " workspace" ) {
202
- if (!filterWorkspace.isString ()) {
203
- continue ;
204
- }
205
201
// needs to be a string comparison, because filterWorkspace is the current_workspace
206
- if (node[" name" ].asString () != filterWorkspace .asString ()) {
202
+ if (node[" name" ].asString () != immediateParent[ " current_workspace " ] .asString ()) {
207
203
continue ;
208
204
}
209
205
parentWorkspace = node;
@@ -239,8 +235,8 @@ std::tuple<std::size_t, int, int, std::string, std::string, std::string> gfnWith
239
235
}
240
236
241
237
// iterate
242
- auto [nb, f, id, name, app_id, workspace_layout] = gfnWithWorkspace (node[" nodes" ], output, config_, bar_, parentWorkspace, filterWorkspace, node);
243
- auto [nb2, f2, id2, name2, app_id2, workspace_layout2] = gfnWithWorkspace (node[" floating_nodes" ], output, config_, bar_, parentWorkspace, filterWorkspace, node);
238
+ auto [nb, f, id, name, app_id, workspace_layout] = gfnWithWorkspace (node[" nodes" ], output, config_, bar_, parentWorkspace, node);
239
+ auto [nb2, f2, id2, name2, app_id2, workspace_layout2] = gfnWithWorkspace (node[" floating_nodes" ], output, config_, bar_, parentWorkspace, node);
244
240
245
241
if ((id > 0 || ((id2 < 0 || name2.empty ()) && id > -1 )) && !name.empty ()) {
246
242
return {nb, f, id, name, app_id, workspace_layout};
@@ -271,7 +267,7 @@ std::tuple<std::size_t, int, int, std::string, std::string, std::string> gfnWith
271
267
std::tuple<std::size_t , int , int , std::string, std::string, std::string> Window::getFocusedNode (
272
268
const Json::Value& nodes, std::string& output) {
273
269
Json::Value placeholder = 0 ;
274
- return gfnWithWorkspace (nodes, output, config_, bar_, placeholder, placeholder, placeholder );
270
+ return gfnWithWorkspace (nodes, output, config_, bar_, placeholder, placeholder);
275
271
}
276
272
277
273
void Window::getTree () {
0 commit comments