Docking branch - example_glfw_metal - abort when moving a window past the edge #9564

Closed
opened 2026-09-29 18:39:04 +00:00 by ypujante · 0 comments
ypujante commented 2026-09-29 18:39:04 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version 1.92.9b, Branch: docking

Back-ends:

imgui_impl_glfw.cpp + imgui_impl_metal.cpp

Compiler, OS:

macOS 27 / clang version 21.0.0

Full config/build information:

// (Copy from the next line. Keep the ``` markers for formatting.)

Dear ImGui 1.92.9b (19291)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=201402
define: __APPLE__
define: __GNUC__=4
define: __clang_version__=21.0.0 (clang-2100.3.34.2)
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
IM_ASSERT: runs expression: OK. expand size: OK
--------------------------------
io.BackendPlatformName: imgui_impl_glfw (3501)
io.BackendRendererName: imgui_impl_metal
io.ConfigFlags: 0x00000483
 NavEnableKeyboard
 NavEnableGamepad
 DockingEnable
 ViewportsEnable
io.ConfigDpiScaleFonts
io.ConfigDpiScaleViewports
io.ConfigViewportsNoDecoration
io.ConfigViewportsNoDefaultParent
io.ConfigMacOSXBehaviors
io.ConfigNavCaptureKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C1E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasVtxOffset
 RendererHasTextures
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,128
io.Fonts->FontLoaderName: stb_truetype
io.DisplaySize: 1280.00,800.00
io.DisplayFramebufferScale: 2.00,2.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:

I checked out imgui-1.92.9b and compiling the example_glfw_metal with no code change. I am using GLFW 3.5.1

I used the following CMakeLists.txt because the Makefile is not compiling GLFW.

cmake_minimum_required(VERSION 3.19)

project(imgui)

set(imgui_CPP_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/../..")

set(imgui_BUILD_SOURCES
    "${imgui_CPP_SRC_DIR}/imgui.cpp"
    "${imgui_CPP_SRC_DIR}/imgui_demo.cpp"
    "${imgui_CPP_SRC_DIR}/imgui_draw.cpp"
    "${imgui_CPP_SRC_DIR}/imgui_tables.cpp"
    "${imgui_CPP_SRC_DIR}/imgui_widgets.cpp"
    "${imgui_CPP_SRC_DIR}/misc/cpp/imgui_stdlib.cpp"
    "${imgui_CPP_SRC_DIR}/backends/imgui_impl_glfw.cpp"
    "${imgui_CPP_SRC_DIR}/backends/imgui_impl_metal.mm"
    )

set(glfw_ROOT_DIR "/Volumes/Scratch/tmp/glfw-3.5.1")

add_subdirectory("${glfw_ROOT_DIR}" glfw)

add_library(imgui STATIC "${imgui_BUILD_SOURCES}")
target_include_directories(imgui PUBLIC "${imgui_CPP_SRC_DIR}" "${imgui_CPP_SRC_DIR}/backends" "${glfw_ROOT_DIR}/include")
target_link_libraries(imgui PUBLIC glfw "-framework Metal" "-framework MetalKit" "-framework Cocoa" "-framework IOKit" "-framework CoreVideo" "-framework QuartzCore")

add_executable(example_glfw_metal "main.mm")
target_include_directories(example_glfw_metal PUBLIC "${imgui_CPP_SRC_DIR}")
target_link_libraries(example_glfw_metal imgui)

As you can see in the video below, when I move the ImGui window to any edge of the native macOS window, the system crashes. Because I am running under a debugger, you can see there is an assert.

Screenshots/Video:

https://github.com/user-attachments/assets/70acb3a7-4bc4-4132-b02d-7485366aef1d

Minimal, Complete and Verifiable Example code:

As stated above, unchanged example_glfw_metal from 1.92.9b compiled with GLFW 3.5.1

### Version/Branch of Dear ImGui: Version 1.92.9b, Branch: docking ### Back-ends: imgui_impl_glfw.cpp + imgui_impl_metal.cpp ### Compiler, OS: macOS 27 / clang version 21.0.0 ### Full config/build information: // (Copy from the next line. Keep the ``` markers for formatting.) ```cpp Dear ImGui 1.92.9b (19291) -------------------------------- sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20 define: __cplusplus=201402 define: __APPLE__ define: __GNUC__=4 define: __clang_version__=21.0.0 (clang-2100.3.34.2) define: IMGUI_HAS_VIEWPORT define: IMGUI_HAS_DOCK IM_ASSERT: runs expression: OK. expand size: OK -------------------------------- io.BackendPlatformName: imgui_impl_glfw (3501) io.BackendRendererName: imgui_impl_metal io.ConfigFlags: 0x00000483 NavEnableKeyboard NavEnableGamepad DockingEnable ViewportsEnable io.ConfigDpiScaleFonts io.ConfigDpiScaleViewports io.ConfigViewportsNoDecoration io.ConfigViewportsNoDefaultParent io.ConfigMacOSXBehaviors io.ConfigNavCaptureKeyboard io.ConfigInputTextCursorBlink io.ConfigWindowsResizeFromEdges io.ConfigMemoryCompactTimer = 60.0 io.BackendFlags: 0x00001C1E HasMouseCursors HasSetMousePos PlatformHasViewports HasMouseHoveredViewport RendererHasVtxOffset RendererHasTextures RendererHasViewports -------------------------------- io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,128 io.Fonts->FontLoaderName: stb_truetype io.DisplaySize: 1280.00,800.00 io.DisplayFramebufferScale: 2.00,2.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: I checked out `imgui-1.92.9b` and compiling the `example_glfw_metal` with no code change. I am using GLFW 3.5.1 I used the following CMakeLists.txt because the Makefile is not compiling GLFW. ```cmake cmake_minimum_required(VERSION 3.19) project(imgui) set(imgui_CPP_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/../..") set(imgui_BUILD_SOURCES "${imgui_CPP_SRC_DIR}/imgui.cpp" "${imgui_CPP_SRC_DIR}/imgui_demo.cpp" "${imgui_CPP_SRC_DIR}/imgui_draw.cpp" "${imgui_CPP_SRC_DIR}/imgui_tables.cpp" "${imgui_CPP_SRC_DIR}/imgui_widgets.cpp" "${imgui_CPP_SRC_DIR}/misc/cpp/imgui_stdlib.cpp" "${imgui_CPP_SRC_DIR}/backends/imgui_impl_glfw.cpp" "${imgui_CPP_SRC_DIR}/backends/imgui_impl_metal.mm" ) set(glfw_ROOT_DIR "/Volumes/Scratch/tmp/glfw-3.5.1") add_subdirectory("${glfw_ROOT_DIR}" glfw) add_library(imgui STATIC "${imgui_BUILD_SOURCES}") target_include_directories(imgui PUBLIC "${imgui_CPP_SRC_DIR}" "${imgui_CPP_SRC_DIR}/backends" "${glfw_ROOT_DIR}/include") target_link_libraries(imgui PUBLIC glfw "-framework Metal" "-framework MetalKit" "-framework Cocoa" "-framework IOKit" "-framework CoreVideo" "-framework QuartzCore") add_executable(example_glfw_metal "main.mm") target_include_directories(example_glfw_metal PUBLIC "${imgui_CPP_SRC_DIR}") target_link_libraries(example_glfw_metal imgui) ``` As you can see in the video below, when I move the ImGui window to any edge of the native macOS window, the system crashes. Because I am running under a debugger, you can see there is an assert. ### Screenshots/Video: https://github.com/user-attachments/assets/70acb3a7-4bc4-4132-b02d-7485366aef1d ### Minimal, Complete and Verifiable Example code: As stated above, unchanged `example_glfw_metal` from 1.92.9b compiled with GLFW 3.5.1
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#9564
No description provided.