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

niri does not send a wl_pointer::enter event when layer surfaces spawn on the pointer #1194

Open
zeroeightysix opened this issue Mar 2, 2025 · 5 comments

Comments

@zeroeightysix
Copy link
Contributor

I'm writing a wayland client using sctk and running into the problem that pointer events aren't getting through if the surface's input region covers the pointer when it spawns. Sctk will refuse to pass on any motion events until it has seen a wl_pointer::enter:

https://github.com/Smithay/client-toolkit/blob/4cf0deff833012bc93e3b58d0f1c1c33bc0ee8bf/src/seat/pointer/mod.rs#L372

The wording of wl_pointer::enter:

"Notification that this seat's pointer is focused on a certain surface."

seems to suggest that this really does need to be sent once the compositor decides that any new pointer events will go to this surface, and not only when the pointer moves from one region to another?

@YaLTeR
Copy link
Owner

YaLTeR commented Mar 2, 2025

It works for me with fuzzel. It gets a wl_pointer.enter() immediately if it spawns under the pointer.

@zeroeightysix
Copy link
Contributor Author

Hm, I might be making a mistake then. I'll see if I can get a minimal reproduction example.

@zeroeightysix
Copy link
Contributor Author

I made this example which reproduces the behaviour for me: https://github.com/zeroeightysix/niri-reproduce-missing-wl-enter

Notably, I did get the enter event if the surface contents are drawn using shm (first commit) but not when using wgpu (second commit).

Am I just setting up rendering wrong?

@YaLTeR
Copy link
Owner

YaLTeR commented Mar 2, 2025

Not sure; I'm not very familiar with wgpu. Could you test on other compositors?

@zeroeightysix
Copy link
Contributor Author

zeroeightysix commented Mar 2, 2025

  • I get the Enter event immediately on sway
  • I get the Enter event along with the first motion event on cosmic

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

No branches or pull requests

2 participants