Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
win32: fix controls in the title bar area can't be hovered
Browse files Browse the repository at this point in the history
Signed-off-by: Yuhang Zhao <[email protected]>
  • Loading branch information
wangwenx190 committed May 15, 2022
1 parent 3a0e6f0 commit c2c6ef1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/core/framelesshelper_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ FRAMELESSHELPER_STRING_CONSTANT(FindWindowW)
return HTCLOSE;
}
}
// The parent window has quite some logic in the hit test handler, we
// should forward this message to the parent window and return what it
// returns to make sure our homemade title bar is still functional.
return SendMessageW(parentWindowHandle, WM_NCHITTEST, 0, lParam);
// Returns "HTTRANSPARENT" to let the mouse event pass through this invisible
// window to the parent window beneath it, otherwise all the controls under it
// can't be hovered.
return HTTRANSPARENT;
}
case WM_NCMOUSEMOVE: {
// When we get this message, it's because the mouse moved when it was
Expand Down Expand Up @@ -350,6 +350,7 @@ FRAMELESSHELPER_STRING_CONSTANT(FindWindowW)
// receive mouse events from our homemade title bar.
if (isMouseEvent) {
SendMessageW(parentWindowHandle, uMsg, wParam, lParam);
return 0; // There's nothing to do in this invisible window, so ignore it.
}
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
}
Expand Down

0 comments on commit c2c6ef1

Please sign in to comment.