Skip to content

Commit 1bc0658

Browse files
committed
win32: repair drag-docking functionality (regression from 8d65f7d)
Fixes #23
1 parent fd8e4b2 commit 1bc0658

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/window.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,16 @@ void Window::mouseUp(const ImGuiMouseButton btn)
259259

260260
if(Platform::getCapture() == m_hwnd && m_mouseDown == 0)
261261
Platform::releaseCapture();
262+
263+
// Clear NoInputs early to avoid sub-frame double-clicks reaching the window
264+
// under only if that window is not one of ours (MouseHoveredViewport) to
265+
// still allow for drag-docking.
262266
if(btn == ImGuiMouseButton_Left && m_ctx->imgui()->MovingWindow &&
263-
m_ctx->imgui()->MovingWindow->Viewport == m_viewport)
267+
m_ctx->imgui()->MovingWindow->Viewport == m_viewport &&
268+
!m_ctx->IO().MouseHoveredViewport) {
264269
m_viewport->Flags &= ~ImGuiViewportFlags_NoInputs;
270+
update(); // for the macOS backend to clear NSWindow's ignoresMouseEvents
271+
}
265272
}
266273

267274
void Window::releaseMouse()

0 commit comments

Comments
 (0)