summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2020-07-09 18:13:02 +0200
committerJehan <jehan@girinstud.io>2020-10-23 17:53:43 +0200
commit7f781c74a46921ace451795e5745a41893ad4e27 (patch)
treecc8fc1b4f0bafe7f95bdf8edb5b0343b7ab74780
parentd955636da584d9f21a3cb875bbe0fcf0cd8aa9aa (diff)
downloadgtk+-wip/Jehan/gimp-issue-1082-transparent-window.tar.gz
Fullscreen windows with WS_EX_NOACTIVATE | WS_EX_TRANSPARENT ...wip/Jehan/gimp-issue-1082-transparent-window
... interfere with UI events. Ignore top-level transparent windows when looking for the top-level GDK window at a certain pointer location, in the Win32 GDK backend. This prevents transparent top-level windows from intercepting mouse events as often the case with screen capturing software. See relevant bug reports at GIMP and Inkscape: https://gitlab.gnome.org/GNOME/gimp/-/issues/1082 https://gitlab.com/inkscape/inbox/-/issues/2976 The relevant issue at GTK is: https://gitlab.gnome.org/GNOME/gtk/-/issues/370 This patch does not necessarily close the whole issue as some cases are apparently still problematic, yet it fixes most instances since reports have greatly diminished since it was applied on downstream builds. Originally contributed by Ell (see commit fb5354c9e5 from GIMP repository) for GTK+2, then ported to GTK+3 by Patrick Storz for the MSYS2 package.
-rw-r--r--gdk/win32/gdkdevice-win32.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c
index 190372de2d..3d89290b25 100644
--- a/gdk/win32/gdkdevice-win32.c
+++ b/gdk/win32/gdkdevice-win32.c
@@ -214,6 +214,10 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
* 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 (hwnd);
@@ -224,8 +228,7 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
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)
@@ -236,6 +239,8 @@ _gdk_device_win32_window_at_position (GdkDevice *device,
hwndc = hwnd;
}
+ /* Only ignore top-level transparent windows */
+ cwp_flags &= ~CWP_SKIPTRANSPARENT;
} while (hwndc != hwnd && (hwnd = hwndc, 1));
}