win: fix a rare bug

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-11-06 16:35:30 +08:00
parent 32d29e39f6
commit 378f59f462
1 changed files with 23 additions and 21 deletions

View File

@ -1452,6 +1452,7 @@ void Utils::maybeFixupQtInternals(const WId windowId)
} else {
WARNING << getSystemErrorMessage(kGetClassLongPtrW);
}
if (!FramelessConfig::instance()->isSet(Option::UseCrossPlatformQtImplementation)) {
SetLastError(ERROR_SUCCESS);
const auto windowStyle = static_cast<DWORD>(GetWindowLongPtrW(hwnd, GWL_STYLE));
if (windowStyle != 0) {
@ -1476,6 +1477,7 @@ void Utils::maybeFixupQtInternals(const WId windowId)
} else {
WARNING << getSystemErrorMessage(kGetWindowLongPtrW);
}
}
if (shouldUpdateFrame) {
triggerFrameChange(windowId);
}