From 8f31e67daed8e298bbcb1e889a0ce4652b095f6e Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Wed, 18 May 2022 09:24:25 +0800 Subject: [PATCH] win32: remove useless error checking Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- src/core/utils_win.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/core/utils_win.cpp b/src/core/utils_win.cpp index d72a16f..1026a64 100644 --- a/src/core/utils_win.cpp +++ b/src/core/utils_win.cpp @@ -558,14 +558,6 @@ void Utils::showSystemMenu(const WId windowId, const QPoint &pos, const bool sel 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); - // TrackPopupMenu returns 0: the user cancelled the menu, or some error occurred. - if (result == 0) { - const DWORD dwError = GetLastError(); - if (dwError != ERROR_SUCCESS) { - qWarning() << __getSystemErrorMessage(kTrackPopupMenu, dwError); - } - return; - } if (PostMessageW(hWnd, WM_SYSCOMMAND, result, 0) == FALSE) { qWarning() << getSystemErrorMessage(kPostMessageW); }