-
-
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
After enabling ConfigViewportsNoDecoration, the mouse coordinates move down #5320
Comments
Yes, I saw them the same |
I can not replicate that, tested on both 18.04 and 22.04. Application always starts in a valid state for me, meaning it correctly reacts to mouse inputs. However dragging it to some desktop panel by holding on to window background indeed produces condition mentioned in #3898 where actual window position and viewport position tracked by imgui desync. Here is a quick workaround: // Apply Position and Size (from ImGui to Platform/Renderer backends)
if ((viewport->LastPlatformPos.x != viewport->Pos.x || viewport->LastPlatformPos.y != viewport->Pos.y) && !viewport->PlatformRequestMove)
{
g.PlatformIO.Platform_SetWindowPos(viewport, viewport->Pos);
viewport->Pos = g.PlatformIO.Platform_GetWindowPos(viewport); //
if (viewport->Window) // Workaround code
viewport->Window->Pos = viewport->Pos; //
} It only works for GLFW, however. SDL tries to be smart and caches position we set from API and thus does react when platform does not set a requested window position. In theory, same issue should surface with window resizing, but we have more issues on that front (resizing from left grip its totally broken), so i ignored it for now. |
hello
|
Platform: Linux-ubuntu
Backend: glfw+OpenGL3
branch:docking
Hello, after I use the following two flags, I open the glfw native window in the imgui tab, but when it starts, the mouse will be vertically offset by a height of the glfw title bar
When I want to click on the green circle, I need to move the mouse to the position of the red circle
Please how do I go about solving it
The text was updated successfully, but these errors were encountered: