mirror of
https://github.com/swaywm/sway.git
synced 2025-04-02 02:17:45 +03:00
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__.
This commit is contained in:
parent
e3d9cc2aa5
commit
048e304b8a
1 changed files with 1 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue