diff options
author | Photon89 | 2019-09-06 10:42:02 +0200 |
---|---|---|
committer | Photon89 | 2019-09-06 10:42:02 +0200 |
commit | ef0ae296fc348d1e9c2cde800b29c754746e6f76 (patch) | |
tree | ea1c26db4d4651644ea11c8f791b491eeb284606 /fix-scrolling.patch | |
parent | c2875e3919ad00305d9ceca34dffa88d8daca723 (diff) | |
download | aur-ef0ae296fc348d1e9c2cde800b29c754746e6f76.tar.gz |
Update to 4.14
Diffstat (limited to 'fix-scrolling.patch')
-rw-r--r-- | fix-scrolling.patch | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/fix-scrolling.patch b/fix-scrolling.patch new file mode 100644 index 000000000000..72f14bc0f45e --- /dev/null +++ b/fix-scrolling.patch @@ -0,0 +1,125 @@ +From 55dc7b400feef0c35fda3e8d3515dada2ced29c4 Mon Sep 17 00:00:00 2001 +From: Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> +Date: Thu, 15 Aug 2019 23:27:25 +0200 +Subject: pager: Fix scrolling in pager-buttons (Bug #15614) + +Unfortunately this doesn't affect the miniature view (aka WnckPager), +where scrolling is handled natively and in a different - broken - order. +--- + common/panel-debug.c | 3 ++- + common/panel-debug.h | 3 ++- + plugins/pager/pager-buttons.c | 2 ++ + plugins/pager/pager.c | 32 +++++++++++++++++++++++++------- + 4 files changed, 31 insertions(+), 9 deletions(-) + +diff --git a/common/panel-debug.c b/common/panel-debug.c +index b554a98f..38af2854 100644 +--- a/common/panel-debug.c ++++ b/common/panel-debug.c +@@ -54,7 +54,8 @@ static const GDebugKey panel_debug_keys[] = + { "positioning", PANEL_DEBUG_POSITIONING }, + { "struts", PANEL_DEBUG_STRUTS }, + { "systray", PANEL_DEBUG_SYSTRAY }, +- { "tasklist", PANEL_DEBUG_TASKLIST } ++ { "tasklist", PANEL_DEBUG_TASKLIST }, ++ { "pager", PANEL_DEBUG_PAGER } + }; + + +diff --git a/common/panel-debug.h b/common/panel-debug.h +index 9d882da9..56175658 100644 +--- a/common/panel-debug.h ++++ b/common/panel-debug.h +@@ -42,7 +42,8 @@ typedef enum + PANEL_DEBUG_POSITIONING = 1 << 12, + PANEL_DEBUG_STRUTS = 1 << 13, + PANEL_DEBUG_SYSTRAY = 1 << 14, +- PANEL_DEBUG_TASKLIST = 1 << 15 ++ PANEL_DEBUG_TASKLIST = 1 << 15, ++ PANEL_DEBUG_PAGER = 1 << 16 + } + PanelDebugFlag; + +diff --git a/plugins/pager/pager-buttons.c b/plugins/pager/pager-buttons.c +index fbac26fe..6c635be6 100644 +--- a/plugins/pager/pager-buttons.c ++++ b/plugins/pager/pager-buttons.c +@@ -368,6 +368,7 @@ pager_buttons_rebuild_idle (gpointer user_data) + vp_info[VIEWPORT_Y] = (n / (workspace_height / screen_height)) * screen_height; + + button = xfce_panel_create_toggle_button (); ++ gtk_widget_add_events (GTK_WIDGET (button), GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK); + if (viewport_x >= vp_info[VIEWPORT_X] && viewport_x < vp_info[VIEWPORT_X] + screen_width + && viewport_y >= vp_info[VIEWPORT_Y] && viewport_y < vp_info[VIEWPORT_Y] + screen_height) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); +@@ -410,6 +411,7 @@ pager_buttons_rebuild_idle (gpointer user_data) + workspace = WNCK_WORKSPACE (li->data); + + button = xfce_panel_create_toggle_button (); ++ gtk_widget_add_events (GTK_WIDGET (button), GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK); + if (workspace == active_ws) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); + g_signal_connect (G_OBJECT (button), "toggled", +diff --git a/plugins/pager/pager.c b/plugins/pager/pager.c +index 40cc7fab..5637bea6 100644 +--- a/plugins/pager/pager.c ++++ b/plugins/pager/pager.c +@@ -32,6 +32,7 @@ + #include <common/panel-xfconf.h> + #include <common/panel-utils.h> + #include <common/panel-private.h> ++#include <common/panel-debug.h> + #include <libwnck/libwnck.h> + + #include "pager.h" +@@ -320,11 +321,12 @@ static gboolean + pager_plugin_scroll_event (GtkWidget *widget, + GdkEventScroll *event) + { +- PagerPlugin *plugin = XFCE_PAGER_PLUGIN (widget); +- WnckWorkspace *active_ws; +- WnckWorkspace *new_ws; +- gint active_n; +- gint n_workspaces; ++ PagerPlugin *plugin = XFCE_PAGER_PLUGIN (widget); ++ WnckWorkspace *active_ws; ++ WnckWorkspace *new_ws; ++ gint active_n; ++ gint n_workspaces; ++ GdkScrollDirection scrolling_direction; + + panel_return_val_if_fail (WNCK_IS_SCREEN (plugin->wnck_screen), FALSE); + +@@ -332,11 +334,27 @@ pager_plugin_scroll_event (GtkWidget *widget, + if (plugin->scrolling == FALSE) + return TRUE; + ++ if (event->direction != GDK_SCROLL_SMOOTH) ++ scrolling_direction = event->direction; ++ else if (event->delta_y < 0) ++ scrolling_direction = GDK_SCROLL_UP; ++ else if (event->delta_y > 0) ++ scrolling_direction = GDK_SCROLL_DOWN; ++ else if (event->delta_x < 0) ++ scrolling_direction = GDK_SCROLL_LEFT; ++ else if (event->delta_x > 0) ++ scrolling_direction = GDK_SCROLL_RIGHT; ++ else ++ { ++ panel_debug_filtered (PANEL_DEBUG_PAGER, "Scrolling event with no delta happened."); ++ return TRUE; ++ } ++ + active_ws = wnck_screen_get_active_workspace (plugin->wnck_screen); + active_n = wnck_workspace_get_number (active_ws); + +- if (event->direction == GDK_SCROLL_UP +- || event->direction == GDK_SCROLL_LEFT) ++ if (scrolling_direction == GDK_SCROLL_UP ++ || scrolling_direction == GDK_SCROLL_LEFT) + active_n--; + else + active_n++; +-- +cgit v1.2.1 + |