The hook is used to intercept keyboard combos in order to provide AeroSnap-like functionality for CSD windows. However it causes significant performance issues, especially on startup of gtk3 apps (those are system-wide and *not* limited to the gtk3 app itself). Performance can be continuously degraded to any console application that is attached to the gtk3 app, e.g. debuggers. Related issues: - https://gitlab.gnome.org/GNOME/gtk/issues/2015 - https://gitlab.gnome.org/GNOME/gtk/issues/1082 - https://gitlab.gnome.org/GNOME/gtk/issues/1033 As the hook is completely useless for non-CSD windows, only install it if CSD is explicitly requested (environment variable GTK_CSD=1).
39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
From 0d860b1994961585b42ea2f25ab5bc8a0fb7331d Mon Sep 17 00:00:00 2001
|
|
From: Patrick Storz <eduard.braun2@gmx.de>
|
|
Date: Sat, 29 Feb 2020 17:53:19 +0100
|
|
Subject: [PATCH] Only install low level keyboard hook if GTK_CSD=1
|
|
|
|
Added in eece8a7dd2405f76829031f3d6dd5e39fb5dc542 in order to
|
|
intercept keyboard combos to provide AeroSnap-like functionality for
|
|
CSD windows.
|
|
|
|
Unfortunately it causes many issues, e.g.
|
|
- https://gitlab.gnome.org/GNOME/gtk/issues/2015
|
|
- https://gitlab.gnome.org/GNOME/gtk/issues/1082
|
|
- https://gitlab.gnome.org/GNOME/gtk/issues/1033
|
|
|
|
As the hook is completely useless for non-CSD windows, only install
|
|
it if CSD is explicitly requested (environment variable GTK_CSD=1).
|
|
---
|
|
gdk/win32/gdkevents-win32.c | 4 +++-
|
|
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
|
|
index 7aef277c27..8b64d7dd22 100644
|
|
--- a/gdk/win32/gdkevents-win32.c
|
|
+++ b/gdk/win32/gdkevents-win32.c
|
|
@@ -530,7 +530,9 @@ _gdk_events_init (GdkDisplay *display)
|
|
g_source_set_can_recurse (source, TRUE);
|
|
g_source_attach (source, NULL);
|
|
|
|
- set_up_low_level_keyboard_hook ();
|
|
+ if (g_strcmp0 (g_getenv ("GTK_CSD"), "1") == 0) {
|
|
+ set_up_low_level_keyboard_hook ();
|
|
+ }
|
|
}
|
|
|
|
gboolean
|
|
--
|
|
2.25.1.windows.1
|
|
|