[Xfce4-commits] [xfce/xfce4-panel] 01/01: Scroll wheel cycling wrap
noreply at xfce.org
noreply at xfce.org
Thu May 15 03:46:59 CEST 2014
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 d87b744020d8d360449e285e2fb4ab3d29dc0589
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 52882de..7ebd77a 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1235,6 +1235,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;
@@ -1258,6 +1259,9 @@ xfce_tasklist_scroll_event (GtkWidget *widget,
&& GTK_WIDGET_VISIBLE (child->button))
break;
}
+
+ /* wrap if the first button is reached */
+ lnew = lnew ? lnew : g_list_last (li);
break;
case GDK_SCROLL_DOWN:
@@ -1269,6 +1273,9 @@ xfce_tasklist_scroll_event (GtkWidget *widget,
&& GTK_WIDGET_VISIBLE (child->button))
break;
}
+
+ /* wrap if the last button is reached */
+ lnew = lnew ? lnew : g_list_first (li);
break;
case GDK_SCROLL_LEFT:
@@ -1280,7 +1287,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