From 306856ca04e9626113d9ae3073cd19b808a59a93 Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Sat, 22 Jun 2019 22:32:45 +0200 Subject: [PATCH] Retain original GDK_CORE_DEVICE_EVENTS setting for plugins (Bug #15044) Previously the panel disabled smooth scrolling for all plugins - and therefore unfortunately also for all applications launched through panel plugins - because of leave/enter notify spam when hovering the panel. With this patch it retains the original setting and passes it down correctly to plugins, which should in turn mean applications would get the correct setting. --- libxfce4panel/xfce-panel-plugin.c | 3 +++ panel/main.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libxfce4panel/xfce-panel-plugin.c b/libxfce4panel/xfce-panel-plugin.c index 4bb6c00d..436403c7 100644 --- a/libxfce4panel/xfce-panel-plugin.c +++ b/libxfce4panel/xfce-panel-plugin.c @@ -730,6 +730,9 @@ xfce_panel_plugin_init (XfcePanelPlugin *plugin) bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); #endif + if (g_getenv ("PANEL_GDK_CORE_DEVICE_EVENTS")) + g_unsetenv ("GDK_CORE_DEVICE_EVENTS"); + /* hide the event box window to make the plugin transparent */ gtk_event_box_set_visible_window (GTK_EVENT_BOX (plugin), FALSE); } diff --git a/panel/main.c b/panel/main.c index 5f6ff08a..e9387efc 100644 --- a/panel/main.c +++ b/panel/main.c @@ -255,7 +255,13 @@ main (gint argc, gchar **argv) #endif /* Workaround for xinput2's subpixel handling triggering unwanted enter/leave-notify events: - * https://bugs.freedesktop.org/show_bug.cgi?id=92681 */ + * https://bugs.freedesktop.org/show_bug.cgi?id=92681 + * We retain the original env var in our own custom env var which we use to re-set the + * original value for plugins. If the env var is not set we treat that as "0", which is Gtk+'s + * default behavior as well. */ + if (!g_getenv ("GDK_CORE_DEVICE_EVENTS")) + g_setenv ("PANEL_GDK_CORE_DEVICE_EVENTS", "0", TRUE); + g_setenv ("GDK_CORE_DEVICE_EVENTS", "1", TRUE); /* parse context options */ -- 2.19.1