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

GLFW backend only AddMouseSourceEvent() on Win32 #8374

Open
ypujante opened this issue Feb 4, 2025 · 3 comments
Open

GLFW backend only AddMouseSourceEvent() on Win32 #8374

ypujante opened this issue Feb 4, 2025 · 3 comments

Comments

@ypujante
Copy link
Contributor

ypujante commented Feb 4, 2025

Version/Branch of Dear ImGui:

Version 1.91.8, Branch: master (master/docking/etc.)

Back-ends:

imgui_impl_glfw.cpp

Compiler, OS:

Emscripten

Details:

This is a follow up to the now closed issue #8373 (see this post)

The backend is not calling AddMouseSourceEvent(ImGuiMouseSource_TouchScreen) so the touch is identified as emitted by a Mouse. Because of how touch have a tendency to instantly teleport to new locations at the time of touch, we need this identification to handle AllowOverlap behaviors.

@ocornut
Copy link
Owner

ocornut commented Feb 4, 2025

As far as I know GLFW doesn't provide that information, so it would need to be added to it somehow (for Linux, OSX, Emscripten etc.). Any form of workaround/PR would be welcome.

We only have a Win32-specific piece of code using raw Win32 data to extract this information.

@ocornut ocornut changed the title GLFW backend does not call AddMouseSourceEvent GLFW backend only AddMouseSourceEvent() on Win32 Feb 4, 2025
@ypujante
Copy link
Contributor Author

ypujante commented Feb 4, 2025

I don't mind taking a look at it for emscripten-glfw...

Could you explain how I would reproduce the problem to know when/if I fix it?

@ocornut
Copy link
Owner

ocornut commented Feb 4, 2025

I don't mind taking a look at it for emscripten-glfw...

It would be better if added to GLFW api.

Could you explain how I would reproduce the problem to know when/if I fix it?

From Changelog:

And see this comment:

As e.g. TabItem() uses ImGuiButtonFlags_AllowItemOverlap when a MousePos + MouseDown happens simultaneously with a touch screen, the tab won't be clicked/selected. Calling io.AddMouseSourceEvent(ImGuiMouseSource_TouchScreen); automatically trickle this event sequence over two updates.

ocornut added a commit that referenced this issue Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants