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

Backends: Add Xlib backend #7262

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

Conversation

clementgallet
Copy link
Contributor

Add Linux Xlib backend for handling events (mouse, mouse cursor, keyboard, clipboard), and offer one example with Xlib+OpenGL3 (using GLX). I didn't look at multi viewports, it should be possible to implement it, and I could do that if requested :)

I wrote this for my libtas project where I hooked code into Linux games, most of which don't use SDL. I thought some other people might be interested.

@ocornut
Copy link
Owner

ocornut commented Jan 24, 2024

Hello,
Thanks for your PR.
Could you compare this to #3372 ?

I've been a little hesitant because #3372 tackle more and is generally more overwhelming (vulkan + multi-viewports). From my POV not being a user of X11 if I merge either I would reliant on other people to provide support. So I may need to ask for a bit ofc commitment from either of you to merge this.

I think it may be sane to merge a simpler version first (more similar to yours) but it would be also sane to review the same-feature pars of #3372 and pick best from both world, if there's something to pick.

Depending on the situation and people's interested in maintaining/improving this, I might decide that it would be preferable to host it on its own repo, or merge into main repo.

Thanks!


XISetMask(xi2_mask, XI_Motion);
XISetMask(xi2_mask, XI_ButtonPress);
XISetMask(xi2_mask, XI_ButtonRelease);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your setup breaks the classic ButtonPress/ButtonRelease events im guessing because you handle them with XInput extension? Would be nice maybe to document that you need to use GenericEvent in the client application or use the classic ButtonPress/ButtonRelease in the backend to avoid blocking them

But im not sure exactly if thats the cause of the classic events not firing, couldn't find anything about it in the docs

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

Successfully merging this pull request may close these issues.

None yet

3 participants