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

WaylandBackend: Ignore events on unknown surfaces #1597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ColinKinloch
Copy link

@ColinKinloch ColinKinloch commented Oct 26, 2024

wl_pointer enter/leave events are being processed for libdecor surfaces (they have the tag libdecor-gtk), this means the surface user_data is being miscast as CWaylandPlane.

Fixes #1445, fixes #1558, fixes #1434

@misyltoad
Copy link
Collaborator

Oh dear... that makes sense...

I wonder if there is a better way than this though. Any libdecor calls we can use?

@ColinKinloch
Copy link
Author

ColinKinloch commented Oct 26, 2024

I'm not in love with my solution either. libdecor_frame_get_wl_surface exists but it's only exposed to the plugins (cairo, gtk). I didn't see anything particularly useful in the api.

The offending surface always seems to be wl_surface#44.

It's also possible that I'm wrong about it being libdecor, I would have thought I'd run into this when adding it to RetroArch.

@ColinKinloch
Copy link
Author

SDL uses wl_proxy_set_tag if that's a solution you'd prefer?
https://github.com/libsdl-org/SDL/blob/main/src/video/wayland/SDL_waylandvideo.c#L391

@ColinKinloch
Copy link
Author

This is an alternative using wl_proxy_set_tag master...ColinKinloch:gamescope:pointer_enter_crash_tag

@misyltoad
Copy link
Collaborator

wl_proxy_set_tag looks much better :)

wl_pointer enter/leave events are being processed for what I think are libdecor surfaces, this
means the surface user_data is being miscast as CWaylandPlane
@ColinKinloch
Copy link
Author

Great.
I switched the branch and fixed the formatting to match the project.

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