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

Commit

Permalink
win32: a little fix
Browse files Browse the repository at this point in the history
Amends commit 8f31e67

Signed-off-by: Yuhang Zhao <[email protected]>
  • Loading branch information
wangwenx190 committed May 18, 2022
1 parent 8f31e67 commit 0665343
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/utils_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,12 @@ void Utils::showSystemMenu(const WId windowId, const QPoint &pos, const bool sel
// menu item per menu at most. Set the item ID to "UINT_MAX" (or simply "-1")
// can clear the default item for the given menu.
SetMenuDefaultItem(hMenu, SC_CLOSE, FALSE);
const int result = TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft()
? TPM_RIGHTALIGN : TPM_LEFTALIGN)), pos.x(), pos.y(), 0, hWnd, nullptr);
const auto result = TrackPopupMenu(hMenu, (TPM_RETURNCMD | (QGuiApplication::isRightToLeft()
? TPM_RIGHTALIGN : TPM_LEFTALIGN)), pos.x(), pos.y(), 0, hWnd, nullptr);
// The user canceled the menu, no need to continue.
if (result == 0) {
return;
}
if (PostMessageW(hWnd, WM_SYSCOMMAND, result, 0) == FALSE) {
qWarning() << getSystemErrorMessage(kPostMessageW);
}
Expand Down

0 comments on commit 0665343

Please sign in to comment.