From 8f61229b171becbb5503ee831142a590ff8cc720 Mon Sep 17 00:00:00 2001 From: Andre Miranda Date: Thu, 18 Feb 2021 22:05:48 -0300 Subject: pager: Add scroll mode WNCK_PAGER_SCROLL_NONE This allows disabling scrolling altogether. --- libwnck/pager.c | 2 ++ libwnck/pager.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libwnck/pager.c b/libwnck/pager.c index c352733..32d146b 100644 --- a/libwnck/pager.c +++ b/libwnck/pager.c @@ -2042,6 +2042,8 @@ wnck_pager_scroll_event (GtkWidget *widget, return FALSE; if (event->direction == GDK_SCROLL_SMOOTH) return FALSE; + if (pager->priv->scroll_mode == WNCK_PAGER_SCROLL_NONE) + return FALSE; absolute_direction = event->direction; diff --git a/libwnck/pager.h b/libwnck/pager.h index ed3988d..c67f2fa 100644 --- a/libwnck/pager.h +++ b/libwnck/pager.h @@ -88,6 +88,7 @@ typedef enum { * @WNCK_PAGER_SCROLL_1D: the #WnckPager will always cycle workspaces in a linear * manner, irrespective of how many rows are configured. (Hint: Better for mice) * Example cycling order with 2 rows and 4 workspaces: 1 2 3 4. + * @WNCK_PAGER_SCROLL_NONE: the #WnckPager will not cycle workspaces. Since 3.40. * * Mode defining in which order scrolling on a #WnckPager will cycle through workspaces. * @@ -95,7 +96,8 @@ typedef enum { */ typedef enum { WNCK_PAGER_SCROLL_2D, - WNCK_PAGER_SCROLL_1D + WNCK_PAGER_SCROLL_1D, + WNCK_PAGER_SCROLL_NONE } WnckPagerScrollMode; GType wnck_pager_get_type (void) G_GNUC_CONST; -- cgit v1.2.1