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

Ignore modifiers on bindsym release, to match i3 behaviour #6616

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

k3d3
Copy link

@k3d3 k3d3 commented Oct 17, 2021

Fixes #6456.

The i3 window manager ignores modifiers when a button is being released. Mimic this behaviour in Sway.


As this is my first commit to Sway, let me know if there's anything else you need!

Thanks

@emersion
Copy link
Member

I don't think this is how i3 behaves. Can someone check?

@k3d3
Copy link
Author

k3d3 commented Oct 17, 2021

Looks like you're right: https://github.com/i3/i3/blob/next/src/bindings.c#L239

They check to see if the bindings are exact. With that being said: https://github.com/i3/i3/blob/next/src/bindings.c#L243

It appears they completely ignore modifiers when a button is being released. In the end, that means I can't push my PTT key if my shift button is held down, but if that's how i3 does it, then c'est la vie.

I can make the appropriate changes to this PR.

Closes swaywm#6456.

The i3 window manager ignores modifiers when a button is being released.
Mimic this behaviour in Sway.
@k3d3 k3d3 changed the title Check bindsym modifier subset, rather than exact state. Ignore modifiers on bindsym release, to match i3 behaviour Oct 17, 2021
@k3d3
Copy link
Author

k3d3 commented Oct 17, 2021

Changes made.

@rpigott rpigott added this to the 1.7 milestone Nov 8, 2021
@emersion emersion added the i3-compat Sway doesn't match i3's behavior label Dec 21, 2021
@emersion emersion removed this from the 1.7 milestone Jan 7, 2022
@emersion
Copy link
Member

emersion commented Jan 7, 2022

The i3 logic is a bit more complicated: it only ignores modifiers if release == B_UPON_KEYRELEASE_IGNORE_MODS, which is set when pressing the keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i3-compat Sway doesn't match i3's behavior
Development

Successfully merging this pull request may close these issues.

keysym --release is unreliable
3 participants