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

Sway sends wl_keyboard modifiers event before sending keymap #8169

Open
tmccombs opened this issue May 21, 2024 · 5 comments
Open

Sway sends wl_keyboard modifiers event before sending keymap #8169

tmccombs opened this issue May 21, 2024 · 5 comments
Labels
bug Not working as intended

Comments

@tmccombs
Copy link
Contributor

tmccombs commented May 21, 2024

  • Sway Version:

    • sway version 1.9
  • Description:

See emersion/slurp#123 and emersion/slurp#124

Basically slurp segfaults in some situations because it gets an event about key modifiers (wl_keyboard.modifiers) before it has received a keymap (wl_keyboard.keymap). Since it hasn't received a keymap yet, it doesn't know how to handle the modifiers event.

The following is an exceprt from the WL_DEBUG output for slurp:


[ 132030.182] [email protected](26178, wl_surface@3, array[0])
[ 132030.186] [email protected](26179, 0, 0, 0, 0)
zsh: segmentation fault (core dumped)  WAYLAND_DEBUG=1 slurp

no keymap event is received prior to this.

What should probably happens is sway makes sure that a keymap has been sent to the application before sending the enter event.

@tmccombs tmccombs added the bug Not working as intended label May 21, 2024
@tmccombs tmccombs changed the title Sway sends wl_keybaord modifiers event before sending keymap Sway sends wl_keyboard modifiers event before sending keymap May 21, 2024
@emersion
Copy link
Member

Reading the wlroots source code, I don't understand how this can happen.

@emersion
Copy link
Member

Hm, I suppose it could happen if wlr_seat_keyboard_notify_modifiers() is called before wlr_seat_set_keyboard()?

The only unguarded call in Sway is in the IME code. Are you using an IME by any chance?

@tmccombs
Copy link
Contributor Author

I'm using wtype to send keyboard events. Maybe that uses the same API as IME?

@layercak3
Copy link

wtype uses virtual keyboard, not text-input (IME). Does it still happen in master? I'm unable to get it to crash on my machine.

@tmccombs
Copy link
Contributor Author

tmccombs commented Sep 8, 2024

Yes, I can still reproduce on master. All I have to do to reproduce is run:

$ wtype no && slurp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

3 participants