Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command criteria only match views #4929

Closed
anrdnet opened this issue Jan 19, 2020 · 1 comment · Fixed by #4949
Closed

Command criteria only match views #4929

anrdnet opened this issue Jan 19, 2020 · 1 comment · Fixed by #4949

Comments

@anrdnet
Copy link
Contributor

anrdnet commented Jan 19, 2020

Some criteria match container attributes (e.g. con_mark, con_id, floating) and many commands operate on containers, but there's no way to apply commands to non-leaf containers using criteria.

$ swaymsg 'splitv'
$ xterm &
$ swaymsg 'focus parent; mark test; focus child'
$ swaymsg '[con_mark="test"] focus'
Error: No matching node.

In i3 this will correctly focus the parent container.

From what I understand criteria are expanded using criteria_get_views which, as the name suggests, only returns views. handler_context.container is then set to view->container. I believe this can be solved by matching on containers instead of views. I can try to make a patch if that is of interest.

  • Sway Version:
$ swaymsg -t get_version
sway version 1.2

but doesn't appear to have changed on current master.

  • Debug Log:
    I don't believe the relevant code paths do much logging. Please let me know otherwise.

  • Configuration File:
    Reproducible with empty/default configuration.

@emersion
Copy link
Member

Patches are definitely welcome to fix this.

RedSoxFan pushed a commit that referenced this issue Feb 5, 2020
Closes #4929

Replaces criteria_get_views with criteria_get_containers which can
return containers without views when the criteria only contains
container properties.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants