diff options
author | Luca Bacci <luca.bacci982@gmail.com> | 2022-02-25 16:47:43 +0100 |
---|---|---|
committer | Luca Bacci <luca.bacci982@gmail.com> | 2022-02-25 17:02:26 +0100 |
commit | f19897e71fd7dedbb6a7d97dc1e2e830cf9f93ca (patch) | |
tree | 5c161601890b77790984d993ecd7d0e2840aaf7f | |
parent | a238488966196b098fed6c7edc46fcd0b55cdacb (diff) | |
download | gtk+-f19897e71fd7dedbb6a7d97dc1e2e830cf9f93ca.tar.gz |
Fix last error reporting when calling GetClipboardOwner
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1402
-rw-r--r-- | gdk/win32/gdkdisplay-win32.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c index 5671e2c254..3afc34ce20 100644 --- a/gdk/win32/gdkdisplay-win32.c +++ b/gdk/win32/gdkdisplay-win32.c @@ -550,11 +550,11 @@ inner_clipboard_window_procedure (HWND hwnd, GdkWindow *stored_owner; GdkWin32Selection *win32_sel = _gdk_win32_selection_get (); + 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 (); |