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

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Aug 28, 2023
1 parent 0ce4746 commit 9279500
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,15 @@ Short answer: it's impossible. Full explaination: of course we can use the same

## Special Thanks

*Ordered by first contribution time*
*Ordered by first contribution time (it may not be very accurate, sorry)*

- [Yuhang Zhao](https://github.com/wangwenx190): Help me create this project. This project is mainly based on his code.
- [Julien](https://github.com/JulienMaille): Help me test this library on many various environments and help me fix the bugs we found. Contributed many code to improve this library. The MainWindow example is mostly based on his code.
- [Altair Wei](https://github.com/altairwei): Help me fix quite some small bugs and give me many important suggestions, the 2.x version is also inspired by his idea during our discussions.
- [Kenji Mouri](https://github.com/MouriNaruto): Give me a lot of help on Win32 native developing.
- [Dylan Liu](https://github.com/mentalfl0w): Help me improve the build process on macOS.
- [SineStriker](https://github.com/SineStriker): He spent almost a whole week helping me improve the Snap Layout implementation, fix potential bugs and give me a lot of useful suggestions. Without his great effort, the new implementation may never come.
- [SineStriker](https://github.com/SineStriker): Spent over a whole week helping me improve the Snap Layout implementation, fixing potential bugs and also give me a lot of professional and useful suggestions. Without his great effort, the new implementation may never come.
- And also thanks to other contributors not listed here! Without their valuable help, this library wouldn't have such good quality and user experience!

## License

Expand Down
21 changes: 9 additions & 12 deletions src/core/framelesshelper_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,11 @@ enum class WindowPart : quint8
struct FramelessWin32HelperData
{
SystemParameters params = {};

// Store the last result of WM_NCHITTEST, it's helpful to handle WM_MOUSEMOVE and WM_NCMOUSELEAVE
// Store the last hit test result, it's helpful to handle WM_MOUSEMOVE and WM_NCMOUSELEAVE.
WindowPart lastHitTestResult = WindowPart::Outside;

// Store true if we blocked a WM_MOUSELEAVE when mouse moves on chrome button, reset when a
// WM_MOUSELEAVE comes or we manually call TrackMouseEvent
// True if we blocked a WM_MOUSELEAVE when mouse moves on chrome button, false when a
// WM_MOUSELEAVE comes or we manually call TrackMouseEvent().
bool mouseLeaveBlocked = false;

Dpi dpi = {};
#if (QT_VERSION < QT_VERSION_CHECK(6, 5, 1))
QRect restoreGeometry = {};
Expand Down Expand Up @@ -471,7 +468,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
}
muData.mouseLeaveBlocked = false;
}

switch (uMsg) {
#if (QT_VERSION < QT_VERSION_CHECK(5, 9, 0)) // Qt has done this for us since 5.9.0
case WM_NCCREATE: {
Expand Down Expand Up @@ -990,12 +987,12 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
}
return true;
}
case WM_MOUSEMOVE: {
if (data.lastHitTestResult != WindowPart::ChromeButton && data.mouseLeaveBlocked) {
case WM_MOUSEMOVE:
if ((data.lastHitTestResult != WindowPart::ChromeButton) && data.mouseLeaveBlocked) {
muData.mouseLeaveBlocked = false;
std::ignore = requestForMouseLeaveMessage(hWnd, false);
}
} break;
break;
case WM_NCMOUSEMOVE:
case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONUP:
Expand Down Expand Up @@ -1140,10 +1137,10 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
#endif // (QT_VERSION < QT_VERSION_CHECK(6, 5, 1))
data.params.forceChildrenRepaint(500);
} break;
case WM_DWMCOMPOSITIONCHANGED: {
case WM_DWMCOMPOSITIONCHANGED:
// Re-apply the custom window frame if recovered from the basic theme.
std::ignore = Utils::updateWindowFrameMargins(windowId, false);
} break;
break;
#if (QT_VERSION < QT_VERSION_CHECK(6, 5, 1))
case WM_ENTERSIZEMOVE: // Sent to a window when the user drags the title bar or the resize border.
case WM_EXITSIZEMOVE: // Sent to a window when the user releases the mouse button (from dragging the title bar or the resize border).
Expand Down

0 comments on commit 9279500

Please sign in to comment.