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

Unexpected behavior when dragging windows to screen's edge #8251

Open
Luc16 opened this issue Dec 19, 2024 · 3 comments
Open

Unexpected behavior when dragging windows to screen's edge #8251

Luc16 opened this issue Dec 19, 2024 · 3 comments

Comments

@Luc16
Copy link

Luc16 commented Dec 19, 2024

Version/Branch of Dear ImGui:

Version 1.91.6, Branch: docking

Back-ends:

imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp

Compiler, OS:

Linux + GCC 11.4

Full config/build information:

Dear ImGui 1.91.6 WIP (19151)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201103
define: __linux__
define: __GNUC__=11
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:

When a window is dragged to an edge of the screen, the position is still updated as if the window was partially outside the screen, but the rendering is clipped. This causes the mouse to be offset when interacting with widgets.

Screenshots/Video:

tela_bug_imgui.mp4

Minimal, Complete and Verifiable Example code:

ImGui::Begin("Image Window");

ImVec2 p = ImGui::GetWindowPos();
ImGui::Text("window pos %.1f %.1f", p.x, p.y);
ImVec2 s = ImGui::GetWindowSize();
ImGui::Text("window size %.1f %.1f", s.x, s.y);

if (ImGui::Button("hover")) {}

ImGui::End();
@GamingMinds-DanielC
Copy link
Contributor

Are you doing something special to restrict the window to remain on the screen, maybe by altering the draw data? Normal behavior should be that the window isn't restricted, and ImGui seems to think that it isn't when processing the inputs.

@ocornut
Copy link
Owner

ocornut commented Dec 20, 2024

This is the main issue we always have with multi-viewports under Linux, e.g. #2117
Our current code always expect our desired size/pos to be successfully applied, which should be fixed.

@BlueMoonHunt
Copy link

I am encountering same issue on Linux [fedora 41]. + being unable to control new window after moving them out of the main sometimes.

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

4 participants