Merge branch 'gdk-win32-fix-issue-1402-gtk4' into 'main'

Fix last error reporting when calling GetClipboardOwner

Closes #1402

See merge request GNOME/gtk!4521
This commit is contained in:
Luca Bacci 2022-02-25 16:54:15 +00:00
commit a5643b0c83

View File

@ -1219,11 +1219,10 @@ inner_clipboard_window_procedure (HWND hwnd,
return DefWindowProcW (hwnd, message, wparam, lparam);
}
SetLastError (0);
hwnd_owner = GetClipboardOwner ();
if ((hwnd_owner == NULL) &&
(GetLastError () != ERROR_SUCCESS))
WIN32_API_FAILED ("GetClipboardOwner");
if (hwnd_owner == NULL && GetLastError () != 0)
WIN32_API_FAILED ("GetClipboardOwner");
hwnd_opener = GetOpenClipboardWindow ();