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

bindsym --release Super_L doesn't work immediately after a mode change #5288

Open
czert opened this issue Nov 14, 2022 · 3 comments · May be fixed by #5383
Open

bindsym --release Super_L doesn't work immediately after a mode change #5288

czert opened this issue Nov 14, 2022 · 3 comments · May be fixed by #5383
Labels
4.21 bug missing-log Read the CONTRIBUTING.md file for instructions

Comments

@czert
Copy link

czert commented Nov 14, 2022

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

My config:

mode "insert" {
    bindsym Super_L mode "transient"
}
mode "transient" {
    bindsym --release Super_L mode "command"
}

When in insert mode, pressing and holding Super_L switches to transient mode. Releasing Super_L then does nothing. Pressing and releasing Super_L once again works fine, the mode switches to command as expected.

Expected Behavior

Expected mode switch from transient to command after the first Super_L key release.

Reproduction Instructions

Use my full config (see below), reload, pres Enter (to get into insert mode), press Left windows key (Super_L), then release it. Press again, release. Then press Enter again to get back into insert mode.

This exact procedure is captured in the log file: https://pastebin.com/AQWrMiUK -- se line 471, where a KeyRelease 133 does not trigger the expected mode change, while later at line 558 it does.

Environment

Output of i3 --moreversion 2>&-:

i3 version: Binary i3 version:  4.21.1 (2022-10-24) © 2009 Michael Stapelberg and contributors
Config file
# i3 config file (v4)

bindsym Return mode "insert"

mode "insert" {
bindsym Super_L mode "transient"
}
mode "transient" {
bindsym --release Super_L mode "command"
}
mode "command" {
bindsym Return mode "insert"
}

bar {
status_command "i3blocks -c /home/pedro/.config/i3blocks/config"
id bar-1
}

Logfile URL: https://pastebin.com/AQWrMiUK
- Linux Distribution & Version: Arch Linux, rolling
- Are you using a compositor (e.g., xcompmgr or compton): no

Let me know if I can provide any more info. I'd love to see this fixed, as I don't see a way around this to achieve what I'm trying to do...

@i3bot i3bot added the bug label Nov 14, 2022
@i3bot
Copy link

i3bot commented Nov 14, 2022

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot i3bot added missing-log Read the CONTRIBUTING.md file for instructions 4.21 labels Nov 14, 2022
@czert
Copy link
Author

czert commented Nov 15, 2022

Some more info: I noticed that if I use caps lock instead of the Super key, this works as expected. It just doesn't work with mod keys (Shift, Super or Hyper).

@slyshot
Copy link
Contributor

slyshot commented Jan 20, 2023

Modifiers aren't matching because it applied the Super_L modifier to Super_L. I suspect this is a problem with xcb, since that's where we get the key state including the modifiers.

slyshot added a commit to slyshot/i3 that referenced this issue Jan 21, 2023
For some reason modifiers are applied to modifier keys being held down when a mode is loaded.
I suspect this is a problem with xcb -- I haven't been able to find another culprit yet.
This strips modifiers of modifier keys. I don't see this breaking anything since modifiers
with modifier keys isn't normally applied and is nonesense from the beginning.

This partially fixes i3#5288. It doesn't fully fix the issue since B_UPON_KEYRELEASE_IGNORE_MODS
can't be applied to a key release binding that didn't get a keypress, so the order that keys are
released when the bindsym is made between modes matters when it shouldn't.

I'm not sure what exactly the fix for that would be-- and it seems like it'd be a much bigger change
than this, and that it would have to deserve it's own commit.
slyshot added a commit to slyshot/i3 that referenced this issue Jan 21, 2023
For some reason modifiers are applied to modifier keys being held down when a mode is loaded.
I suspect this is a problem with xcb -- I haven't been able to find another culprit yet.
This strips modifiers of modifier keys. I don't see this breaking anything since modifiers
with modifier keys isn't normally applied and is nonesense from the beginning.

This partially fixes i3#5288. It doesn't fully fix the issue since B_UPON_KEYRELEASE_IGNORE_MODS
can't be applied to a key release binding that didn't get a keypress, so the order that keys are
released when the bindsym is made between modes matters when it shouldn't.

I'm not sure what exactly the fix for that would be-- and it seems like it'd be a much bigger change
than this, and that it would have to deserve it's own commit.
slyshot added a commit to slyshot/i3 that referenced this issue Jan 21, 2023
For some reason modifiers are applied to modifier keys being held down when a mode is loaded.
I suspect this is a problem with xcb -- I haven't been able to find another culprit yet.
This strips modifiers of modifier keys. I don't see this breaking anything since modifiers
with modifier keys isn't normally applied and is nonesense from the beginning.

This partially fixes i3#5288. It doesn't fully fix the issue since B_UPON_KEYRELEASE_IGNORE_MODS
can't be applied to a key release binding that didn't get a keypress, so the order that keys are
released when the bindsym is made between modes matters when it shouldn't.

I'm not sure what exactly the fix for that would be-- and it seems like it'd be a much bigger change
than this, and that it would have to deserve it's own commit.
@slyshot slyshot linked a pull request Jan 21, 2023 that will close this issue
slyshot added a commit to slyshot/i3 that referenced this issue Jan 21, 2023
For some reason modifiers are applied to modifier keys being held down when a mode is loaded.
I suspect this is a problem with xcb -- I haven't been able to find another culprit yet.
This strips modifiers of modifier keys. I don't see this breaking anything since modifiers
with modifier keys isn't normally applied and is nonesense from the beginning.

This partially fixes i3#5288. It doesn't fully fix the issue since B_UPON_KEYRELEASE_IGNORE_MODS
can't be applied to a key release binding that didn't get a keypress, so the order that keys are
released when the bindsym is made between modes matters when it shouldn't.

I'm not sure what exactly the fix for that would be-- and it seems like it'd be a much bigger change
than this, and that it would have to deserve it's own commit.
slyshot added a commit to slyshot/i3 that referenced this issue Jan 21, 2023
For some reason modifiers are applied to modifier keys being held down when a mode is loaded.
I suspect this is a problem with xcb, as that's where we get key state.
This strips modifiers of modifier keys. I don't see this breaking anything since modifiers
with modifier keys isn't normally applied and is nonesense from the beginning.

This fixes i3#5288.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.21 bug missing-log Read the CONTRIBUTING.md file for instructions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants