Backend: improve/fix #7262 Xlib/X11 backend#9296
Open
Wildric-Auric wants to merge 2 commits intoocornut:masterfrom
Open
Backend: improve/fix #7262 Xlib/X11 backend#9296Wildric-Auric wants to merge 2 commits intoocornut:masterfrom
Wildric-Auric wants to merge 2 commits intoocornut:masterfrom
Conversation
The fix covers many aspect: -Removed XInput dependency, use only core X11 features -Fixed space not working for texts, space char was not pushed to ImGui -Fixed stuck modifiers -Fixed mouse wheel event firing twice
Owner
|
Thank you Oussama for your PR and for neatly pushing as a two separate commits.
May I ask:
Out of experience code for tech I don't use on a daily basis are really problematic in terms of maintenance, and I really worry that this might lead to waves of support requests that are difficult for me to deal with. This however has the potential to be easier to implement subtle features/fix that are difficult to do with SDL3/GLFW, and eventually be a better alternative to them, which might potentially actually reduce support requests. |
Author
|
Thank you for the fast reply!
I’m available if you need any more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently moved to Linux and was quite surprised that there is no X11 backend in Dear ImGui repository.
I found #7262 which was simple and fine for my needs but it had many problems. This pull request describes and fixes them.
XInput extension breaks core button events, which is not desirable if those are used somewhere else.
As highlighted by the reviewer in Backends: Add Xlib backend #7262, there is no need for that dependency. This pull request fixes this and use core X11 features.
Fixed space not working for texts, the space character was not pushed which broke text inputs and other features.
Fixed stuck modifiers: Modifier events were updated incorrectly, they were pushed on every key event, which completely broke many features such as DragScalars step. My guess is that the developer took inspiration from win32 backend but without noticing the behaviour of
ImGui_ImplWin32_ProcessKeyEventsWorkarounds.Fixed mouse wheel event firing twice: Mouse wheel event was registered twice, because Linux has a release event for the mouse wheel.
All these fixes were tested.
I took a quick look at #3372, I didn't test it. The main difference is that they use XCB instead of xlib; and of course that pull request tackles multiple viewports which we don't do here.
I'm willing to maintain this if you decide to merge it.