diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2025-03-07 10:55:52 -0500 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2025-03-07 10:55:52 -0500 |
| commit | f745b835f288dfd8058979fe1530f66e872a4ba8 (patch) | |
| tree | bda32d7e19c0662feb40f3fabdfefdd318d87369 | |
| parent | c222fc74ebf9379108bdfacb7c973aef1d1f1bd5 (diff) | |
Remove constraint that con->view != NULL to use __focused__ criteria
To use something like:
[con_id=__focused__] mark --add --toggle foo
The container must currently have a view. However, it is possible to
focus parent containers that do not have a view. For example, via:
focus parent
Since containers without views can be the focused (meaning the container
is marked "focused": true in the output of: swaymsg -t get_tree), it
seems reasonable that a view is not required to target a container via
__focused__.
| -rw-r--r-- | sway/criteria.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sway/criteria.c b/sway/criteria.c index 0aefa008..29f73f69 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -630,8 +630,7 @@ static bool parse_token(struct criteria *criteria, char *name, char *value) { if (strcmp(value, "__focused__") == 0) { struct sway_seat *seat = input_manager_current_seat(); struct sway_container *focus = seat_get_focused_container(seat); - struct sway_view *view = focus ? focus->view : NULL; - criteria->con_id = view ? view->container->node.id : 0; + criteria->con_id = focus ? focus->node.id : 0; } else { criteria->con_id = strtoul(value, &endptr, 10); if (*endptr != 0) { |
