-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
A vertical offset on ubuntu when a panel is separated from the main window #3898
Comments
2021-03-11.13-01-01.movI just tried the glfw backend, and the issue is the same. I think I know how to reproduce it now. when the demo panel was first detached, I tried to move it by dragging the title bar. But because the imgui window can't be moved outside the screen boundary (see #3899 ), the mouse cursor starts to move away from the title bar. And then, if I release the mouse, I will introduce an offset. it seems that imgui remembers the hit point when the dragging movement starts, and still uses that point as the mouse location when dragging stops. It doesn't expect relative cursor position would change during dragging. |
after more tries, I think my previous assessment wasn't accurate. I think what's happening is that the imgui window's rectangle was actually moved to the outside of the screen. but when rendering, that window is still rendered inside the screen. However when responding to mouse event, the actual rectangle is used. That caused the offset effect. |
It is a known issue which we reported to SDL and GLFW and are waiting for fixes. |
I believe there's two sides to this issue. But the bug on dear imgui side, reported so many times and in so many flavors in #2117 is that we don't properly react to this limitation and expect our platform windows to be at position A (that was requested) when it is in fact at position B. This is the core issue with multi-viewports on Linux which hasn't been solved/fixed since #2117 was started. |
…een bounds while WM forces window to remain within screen bounds. (ocornut#3898, ocornut#3899) Only helps GLFW, because glfwGetWindowPos() correctly returns actual window position. SDL_GetWindowPosition() on the other hand returns window position before WM restricting window movement, which does not match actual window position on screen.
…een bounds while WM forces window to remain within screen bounds. (ocornut#3898, ocornut#3899)
FWIW, the following code keeps SDL and ImGui in sync in this regard.
Hope this helps others. |
Version/Branch of Dear ImGui:
f1bf642
Version: 1.82 WIP
Branch: docking
Back-end/Renderer/Compiler/OS
Tried both opengl3 and vulkan/ sdl,
gcc-8
ubuntu 18.04 on nvidia / xwindows
Back-ends: imgui_impl_sdl.cpp, vulkan / opengl3
Compiler: gcc-8
Operating System: ubuntu 18.04
My Issue/Question:
I'm testing the docking branch with the official examples. I have tried both the vulkan backend and the opengl3 backend. I have noticed some issues.
One problem is that I noticed a mouse position offset, if the demo window is separated from the main window. The issue is kinda intermittent, because there was one time, after I dragged the main window around, somehow that fixed the offset issue.
It seems that the vertical offset equals the distance between to top boundary and the top border of my screen.
Screenshots/Video
Standalone, minimal, complete and verifiable example:
this is the same official demo, but it has a CMake file
testimgui.zip
The text was updated successfully, but these errors were encountered: