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

Modifiers aren't sent to clients with pointer focus #826

Open
sodiboo opened this issue Nov 23, 2024 · 1 comment
Open

Modifiers aren't sent to clients with pointer focus #826

sodiboo opened this issue Nov 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sodiboo
Copy link
Contributor

sodiboo commented Nov 23, 2024

The documentation for wl_keyboard::modifiers states:

The compositor may send this event without a surface of the client having keyboard focus, for example to tie modifier information to pointer focus instead.

But niri doesn't currently do this. It only sends this event upon keyboard focus.


You can notice this in e.g. a web browser. Focusing a tab in firefox, then focusing a different window entirely (and not another firefox window), then holding Shift and then pressing a different tab should cause the range of tabs to be selected. Instead, it only focuses the second tab. Do the same thing but don't focus a different window, and the range will be selected as expected.

This can also be noticed in my wayland backend branch, which now handles the modifiers event (sodiboo@8c1a0c5). Unfocus the nested compositor, then hold Alt to initiate an interactive move, and try to move a window by LMB-dragging anywhere on it. Nothing will happen. You can only initiate interactive move with the modifier if the nested compositor is already focused. This is how i noticed the issue exists in the first place.


Given that routing of such events is mostly handled by Smithay, this might be an entirely smithay-side issue? But i'm not quite sure, and didn't feel like investigating to be honest. I have not extensively investigated whether other compositors have the same issue, but i'm pretty sure labwc does have the same issue.


System Information

  • niri version: niri unstable 2024-11-10 (commit 8b50845)
  • Distro: NixOS 24.11.20241109.76612b1 (Vicuna)
  • GPU: AMD Radeon RX 7800 XT
  • CPU: AMD Ryzen 5 7600X
@sodiboo sodiboo added the bug Something isn't working label Nov 23, 2024
@YaLTeR
Copy link
Owner

YaLTeR commented Nov 23, 2024

Interesting. Yeah I'm also not sure, might be something for Smithay to handle. Especially since pointer grabs arbitrarily modify which surface has pointer focus. (Which btw is why I recently renamed the niri variable from pointer_focus to pointer_contents.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants