Skip to content

Clicking an OSX app title bar clears the focused item in the window #8574

Open
@Pix3lP3rf3ct

Description

@Pix3lP3rf3ct

Version/Branch of Dear ImGui:

v1.91.9 WIP Docking

Back-ends:

Custom

Compiler, OS:

Clang 16

Full config/build information:

Dear ImGui 1.91.9 WIP (19186)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=202002
define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
define: IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
define: IMGUI_DISABLE_FILE_FUNCTIONS
define: IMGUI_DISABLE_DEFAULT_ALLOCATORS
define: __APPLE__
define: __GNUC__=4
define: __clang_version__=16.0.0 (clang-1600.0.26.6)
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: NULL
io.BackendRendererName: imgui_impl_TGCEngine
io.ConfigFlags: 0x00000081
 NavEnableKeyboard
 DockingEnable
io.ConfigViewportsNoDecoration
io.ConfigMacOSXBehaviors
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigWindowsMoveFromTitleBarOnly
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001408
 PlatformHasViewports
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 1024,2048
io.DisplaySize: 2586.00,1493.00
io.DisplayFramebufferScale: 2.00,2.00
--------------------------------
style.WindowPadding: 6.00,6.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,4.00
style.FrameRounding: 2.00
style.FrameBorderSize: 1.00
style.ItemSpacing: 6.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Details:

Clicking the native OSX window title bar to drag the window causes the internal focused window to be cleared. This causes the user to have to click back into the window to set the focus before triggering any shortcuts.

Screenshots/Video:

Tests tab has focus.
Image

After clicking on the title bar you can see it has lost focus.
Image

Callstack.
Image

Code that clears the focus.
Image

Commenting that line out fixes the issue. That isn't the right solution but shows there needs to be more logic around that call.

Minimal, Complete and Verifiable Example code:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions