diff options
author | Luca Bacci <luca.bacci982@gmail.com> | 2022-02-25 16:54:15 +0000 |
---|---|---|
committer | Luca Bacci <luca.bacci982@gmail.com> | 2022-02-25 16:54:15 +0000 |
commit | a5643b0c830eee8562a1a2cbecbdd3449f5f80eb (patch) | |
tree | f11073a4ad67676f2d07537c6dc34eae25270815 | |
parent | fc47b913b10bc985d68c20331a4033299d312d25 (diff) | |
parent | 828688d5cd736898d2d5692f08c24351b18b0358 (diff) | |
download | gtk+-a5643b0c830eee8562a1a2cbecbdd3449f5f80eb.tar.gz |
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
-rw-r--r-- | gdk/win32/gdkclipdrop-win32.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gdk/win32/gdkclipdrop-win32.c b/gdk/win32/gdkclipdrop-win32.c index 5fa826c261..ec15f0fabd 100644 --- a/gdk/win32/gdkclipdrop-win32.c +++ b/gdk/win32/gdkclipdrop-win32.c @@ -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 (); |