[Xfce4-commits] [xfce/xfce4-panel] 24/73: Scroll wheel cycling wrap

noreply at xfce.org noreply at xfce.org
Sun Feb 26 16:34:05 CET 2017


This is an automated email from the git hooks/post-receive script.

andrzejr pushed a commit to branch master
in repository xfce/xfce4-panel.

commit 666bb0f2be1f3017d3e2a5c983ef46be89b3686d
Author: Andre Miranda <andreldm1989 at gmail.com>
Date:   Wed May 14 21:46:03 2014 -0300

    Scroll wheel cycling wrap
---
 plugins/tasklist/tasklist-widget.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 240b3dc..29530ec 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1283,6 +1283,7 @@ xfce_tasklist_scroll_event (GtkWidget      *widget,
   if (!tasklist->window_scrolling)
     return TRUE;
 
+  /* get the current active button */
   for (li = tasklist->windows; li != NULL; li = li->next)
     {
       child = li->data;
@@ -1306,6 +1307,9 @@ xfce_tasklist_scroll_event (GtkWidget      *widget,
               && gtk_widget_get_visible (child->button))
             break;
         }
+
+      /* wrap if the first button is reached */
+      lnew = lnew ? lnew : g_list_last (li);
       break;
 
     case GDK_SCROLL_DOWN:
@@ -1317,6 +1321,9 @@ xfce_tasklist_scroll_event (GtkWidget      *widget,
               && gtk_widget_get_visible (child->button))
             break;
         }
+
+      /* wrap if the last button is reached */
+      lnew = lnew ? lnew : g_list_first (li);
       break;
 
     case GDK_SCROLL_LEFT:
@@ -1332,7 +1339,7 @@ xfce_tasklist_scroll_event (GtkWidget      *widget,
       break;
     }
 
-  if (lnew != NULL)
+  if (G_LIKELY(lnew != NULL))
     xfce_tasklist_button_activate (lnew->data, event->time);
 
   return TRUE;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list