Fix emulate message bug and git modules
This commit is contained in:
parent
bdb1b5d68f
commit
ff5683ec7d
|
@ -1,3 +1,3 @@
|
||||||
[submodule "cmake"]
|
[submodule "cmake"]
|
||||||
path = cmake
|
path = cmake
|
||||||
url = ../cmake-utils.git
|
url = ../wangwenx190/cmake-utils.git
|
||||||
|
|
|
@ -345,19 +345,20 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
|
||||||
#endif // (QT_VERSION < QT_VERSION_CHECK(6, 5, 1))
|
#endif // (QT_VERSION < QT_VERSION_CHECK(6, 5, 1))
|
||||||
|
|
||||||
const auto emulateClientAreaMessage = [hWnd, uMsg, wParam, lParam](const std::optional<int> overrideMessage = std::nullopt) -> void {
|
const auto emulateClientAreaMessage = [hWnd, uMsg, wParam, lParam](const std::optional<int> overrideMessage = std::nullopt) -> void {
|
||||||
const auto wparam = [uMsg, wParam]() -> WPARAM {
|
auto myMsg = overrideMessage.value_or(uMsg);
|
||||||
if (uMsg == WM_NCMOUSELEAVE) {
|
const auto wparam = [myMsg, wParam]() -> WPARAM {
|
||||||
|
if (myMsg == WM_NCMOUSELEAVE) {
|
||||||
return kMessageTag;
|
return kMessageTag;
|
||||||
}
|
}
|
||||||
const quint64 keyState = Utils::getKeyState();
|
const quint64 keyState = Utils::getKeyState();
|
||||||
if ((uMsg >= WM_NCXBUTTONDOWN) && (uMsg <= WM_NCXBUTTONDBLCLK)) {
|
if ((myMsg >= WM_NCXBUTTONDOWN) && (myMsg <= WM_NCXBUTTONDBLCLK)) {
|
||||||
const auto xButtonMask = GET_XBUTTON_WPARAM(wParam);
|
const auto xButtonMask = GET_XBUTTON_WPARAM(wParam);
|
||||||
return MAKEWPARAM(keyState, xButtonMask);
|
return MAKEWPARAM(keyState, xButtonMask);
|
||||||
}
|
}
|
||||||
return keyState;
|
return keyState;
|
||||||
}();
|
}();
|
||||||
const auto lparam = [uMsg, lParam, hWnd]() -> LPARAM {
|
const auto lparam = [myMsg, lParam, hWnd]() -> LPARAM {
|
||||||
if (uMsg == WM_NCMOUSELEAVE) {
|
if (myMsg == WM_NCMOUSELEAVE) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const auto screenPos = POINT{ GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
const auto screenPos = POINT{ GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
|
||||||
|
@ -373,7 +374,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me
|
||||||
#else
|
#else
|
||||||
# define SEND_MESSAGE ::PostMessageW
|
# define SEND_MESSAGE ::PostMessageW
|
||||||
#endif
|
#endif
|
||||||
switch (overrideMessage.value_or(uMsg)) {
|
switch (myMsg) {
|
||||||
case WM_NCHITTEST: // Treat hit test messages as mouse move events.
|
case WM_NCHITTEST: // Treat hit test messages as mouse move events.
|
||||||
case WM_NCMOUSEMOVE:
|
case WM_NCMOUSEMOVE:
|
||||||
SEND_MESSAGE(hWnd, WM_MOUSEMOVE, wparam, lparam);
|
SEND_MESSAGE(hWnd, WM_MOUSEMOVE, wparam, lparam);
|
||||||
|
|
Loading…
Reference in New Issue