imgui icon indicating copy to clipboard operation
imgui copied to clipboard

SDL3 viewport move/resize issues.

Open lailoken opened this issue 8 months ago • 0 comments

Version/Branch of Dear ImGui:

1.92.0 WIP (19193) (docking)

Back-ends:

imgui_impl_sdl3 + imgui_impl_opengl3

Compiler, OS:

GCC, Linux X11

Full config/build information:

Dear ImGui 1.92.0 WIP (19193)
--------------------------------
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_sdl3
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000483
 NavEnableKeyboard
 NavEnableGamepad
 DockingEnable
 ViewportsEnable
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigWindowsMoveFromTitleBarOnly
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x0000140E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 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:

Note, these issues are not present on the SDL2 backend and works reliably there. This has been tested using the SDL3 samples.

  1. ConfigWindowsResizeFromEdges=true and/or ConfigWindowsMoveFromTitleBarOnly=false sometimes stops resizing/moving when the mouse is moved quickly (is outside the window bounds in a single frame?), resizing is particularly troublesome (taskbar / window decorations works fine).

  2. ConfigWindowsMoveFromTitleBarOnly=false which allows dragging windows anywhere on the content does not seem to work correctly when the OS window manager already has similar functionality, like with Xfce4 where you can alt-drag any window with left button (and easy alt-drag resize with right button). When I do alt-dragging my window moves the correct amount, but them all widgets are offset by an addition amount (the same amount I dragged), leaving me to conclude it is done doubly.

For 2), This works fine on SDL2 whether the OS alt-drag is on or not, just SDL3 seems to be wrong.

Screenshots/Video:

In this sample, I had just dragged this viewport up by about a line using the window manager's alt-drag functionality:

Image

Minimal, Complete and Verifiable Example code:

Using defaulty SDL3 sample.

lailoken avatar Apr 24 '25 14:04 lailoken