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

Apply window-specific bindings when the title/class changes on Sway #525

Open
the-blank-x opened this issue Jun 30, 2023 · 2 comments · May be fixed by #545
Open

Apply window-specific bindings when the title/class changes on Sway #525

the-blank-x opened this issue Jun 30, 2023 · 2 comments · May be fixed by #545

Comments

@the-blank-x
Copy link

When I open a window on sway (well, technically swayfx), keyd-application-mapper does not apply keybinds with a class expression (at least for pinentry-gtk2 and Librewolf) until I refocus the window. I don't know if this applies to all wlroots-based compositors. I believe this is because the window is focused before the mapper gets the class/app id, as I can see the following events happen if I apply show-wlroots-events.patch.gz:

  • A new window is opened
  • The new window has set its title to pinentry-gtk2
  • My terminal is unfocused
  • pinentry-gtk2 is focused (this is when the mapper resets keyd and applies window-specific bindings)
  • pinentry-gtk2 has set its app id/class to Pinentry-gtk-2

Here are the snippets for the output with the patch applied:

Opening pinentry-gtk2
obj: 0x4
event: 0
payload (hex): 050000ff
payload (rep): b'\x05\x00\x00\xff'

obj: 0xff000005 (pinentry-gtk2)
event: 0
payload (hex): 0e00000070696e656e7472792d67746b32000000
payload (rep): b'\x0e\x00\x00\x00pinentry-gtk2\x00\x00\x00'

obj: 0xff000003 (foot)
event: 4
payload (hex): 00000000
payload (rep): b'\x00\x00\x00\x00'

obj: 0xff000005 (pinentry-gtk2)
event: 4
payload (hex): 0400000002000000
payload (rep): b'\x04\x00\x00\x00\x02\x00\x00\x00'

obj: 0xff000005 (pinentry-gtk2)
event: 1
payload (hex): 0f00000050696e656e7472792d67746b2d320000
payload (rep): b'\x0f\x00\x00\x00Pinentry-gtk-2\x00\x00'

obj: 0xff000005 (pinentry-gtk2)
event: 5
payload (hex):
payload (rep): b''

obj: 0xff000003 (foot)
event: 5
payload (hex):
payload (rep): b''
Opening LibreWolf
obj: 0x4
event: 0
payload (hex): 050000ff
payload (rep): b'\x05\x00\x00\xff'

obj: 0xff000005 (LibreWolf)
event: 0
payload (hex): 0a0000004c69627265576f6c66000000
payload (rep): b'\n\x00\x00\x00LibreWolf\x00\x00\x00'

obj: 0xff000003 (foot)
event: 4
payload (hex): 00000000
payload (rep): b'\x00\x00\x00\x00'

obj: 0xff000005 (LibreWolf)
event: 4
payload (hex): 0400000002000000
payload (rep): b'\x04\x00\x00\x00\x02\x00\x00\x00'

obj: 0xff000005 (LibreWolf)
event: 1
payload (hex): 0a0000004c69627265576f6c66000000
payload (rep): b'\n\x00\x00\x00LibreWolf\x00\x00\x00'

obj: 0xff000005 (LibreWolf)
event: 5
payload (hex):
payload (rep): b''

obj: 0xff000003 (foot)
event: 5
payload (hex):
payload (rep): b''
@voronind-com
Copy link

Any known workarounds for this?

@the-blank-x
Copy link
Author

#545 has a proper fix for this—not yet merged for whatever reason, but I've been running it fine ever since

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants