MINGW-packages/mingw-w64-gtk2/0013_fix_mouse_events.patch
Patrick Storz 023eb8614b gtk2: add patch from GIMP project (#4254)
This prevents transparent top-level windows from intercepting mouse
events as often the case with screen capturing software, see
https://bugzilla.gnome.org/show_bug.cgi?id=780979
2018-08-20 10:03:11 +03:00

33 lines
1.3 KiB
Diff

--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -2767,6 +2767,10 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
* WindowFromPoint() can find our windows, we follow similar logic
* here, and ignore invisible and disabled windows.
*/
+ UINT cwp_flags = CWP_SKIPDISABLED |
+ CWP_SKIPINVISIBLE |
+ CWP_SKIPTRANSPARENT;
+
hwnd = GetDesktopWindow ();
do {
window = gdk_win32_handle_table_lookup ((GdkNativeWindow) hwnd);
@@ -2777,8 +2781,7 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
break;
screen_to_client (hwnd, screen_pt, &client_pt);
- hwndc = ChildWindowFromPointEx (hwnd, client_pt, CWP_SKIPDISABLED |
- CWP_SKIPINVISIBLE);
+ hwndc = ChildWindowFromPointEx (hwnd, client_pt, cwp_flags);
/* Verify that we're really inside the client area of the window */
if (hwndc != hwnd)
@@ -2789,6 +2792,8 @@ _gdk_windowing_window_at_pointer (GdkDisplay *display,
hwndc = hwnd;
}
+ /* Only ignore top-level transparent windows */
+ cwp_flags &= ~CWP_SKIPTRANSPARENT;
} while (hwndc != hwnd && (hwnd = hwndc, 1));
}