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

Mouse and Window Desynchronization on Ubuntu with Docking Branch #8330

Open
mpichelm opened this issue Jan 19, 2025 · 6 comments
Open

Mouse and Window Desynchronization on Ubuntu with Docking Branch #8330

mpichelm opened this issue Jan 19, 2025 · 6 comments

Comments

@mpichelm
Copy link

Version/Branch of Dear ImGui:

Version 1.91.8 WIP (19171), Branch: docking

Back-ends:

imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp

Compiler, OS:

Ubuntu 24.01.1 LTS + g++ 13.3.0

Full config/build information:

Dear ImGui 1.91.8 WIP (19171)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201103
define: __linux__
define: __GNUC__=13
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000483
 NavEnableKeyboard
 NavEnableGamepad
 DockingEnable
 ViewportsEnable
io.ConfigViewportsNoDecoration
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C0E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1280.00,720.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

Hi!

I'm encountering an issue with the docking branch related to window dragging. Specifically, when I drag a window to the edge of the screen, the window stops at the border, but the mouse pointer continues moving. This causes the mouse pointer and the window to become desynchronized.

Issue Details

  • Reproducible Example: The issue can be reproduced using the example_glfw_opengl3 sample in the current 1.91.8 WIP version.
  • Platform Specificity:
    • Ubuntu (g++): The issue occurs consistently.
    • Windows: The behavior differs and works as expected. On Windows, dragging a window to the screen's edge allows it to move partially outside the screen, which matches the expected behavior.
  • I've attached a video for clarity on the problem.

Steps to Reproduce

  1. Run the example_glfw_opengl3 sample and navigate to the "Dockspace" example in the "Examples" menu.
  2. Drag a window to the bottom of the screen. Continue dragging after the window reaches the edge, allowing the mouse pointer to move further.
  3. Attempt to interact with the window by clicking inside it. You'll notice the mouse pointer is desynchronized and has an offset.
  4. If you manage to click the window's top bar, you can drag it back up, which seems to temporarily recover the synchronization. However, the window becomes unstable and shaky.
  5. Deleting the .ini file and restarting the program is required to fully recover normal functionality.

Please let me know if you need additional details, testing, or logs to address this issue. I really appreciate your support, thanks!

Screenshots/Video:

Screencast.from.2025-01-19.09-57-50.webm

Minimal, Complete and Verifiable Example code:

The example_glfw_opengl3 sample in the current 1.91.8 WIP version can be used to test it.

@PathogenDavid
Copy link
Contributor

I believe this is a duplicate of #3899 and #8251

Unfortunately the issue is upstream of Dear ImGui (and possibly even upstream of GLFW/SDL): #3899 (comment)

It might be worth trying @rokups's workaround: rokups@cdcd58a

@ocornut
Copy link
Owner

ocornut commented Jan 20, 2025

Might also be same as #6711. I should investigate this eventually as I can repro on a Mac too.

@mpichelm
Copy link
Author

Thank you both for your quick feedback! And I'm sorry about the duplicate... I guess my initial research was not good enough. I will try the workaround as soon as possible, thanks for the suggestion!

@ocornut
Copy link
Owner

ocornut commented Jan 20, 2025

I must apologize that this problem hasn't been problem for a long while, principally because it doesn't reproduce on Windows.
I will try to address this...

@mpichelm
Copy link
Author

No need to apologize, the library is fantastic! After reading the other issues you mentioned, I can see why this might be challenging to address. I’ll stay tuned for any updates if a solution is found. Thank you so much for your dedication!

@PathogenDavid
Copy link
Contributor

And I'm sorry about the duplicate... I guess my initial research was not good enough.

No worries at all! It's a weird problem to describe so it's people are going to use different terminology.

(I actually had to re-find them by looking through all the issues labeled both multi-viewports and Linux since I knew they existed but my keyword searches also drew a blank.)

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

3 participants