[Xfce4-commits] [xfce/xfce4-panel] 01/04: tasklist: Make grouped buttons active (Bug #9129)

noreply at xfce.org noreply at xfce.org
Wed Nov 28 16:34:17 CET 2018


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

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-panel.

commit f8d673c5024af0cd6b7f2bb63f2ffa434a708faa
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed Nov 28 14:39:14 2018 +0100

    tasklist: Make grouped buttons active (Bug #9129)
---
 plugins/tasklist/tasklist-widget.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index 80a0de1..eb41a2c 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -1641,6 +1641,7 @@ xfce_tasklist_active_window_changed (WnckScreen   *screen,
                                      XfceTasklist *tasklist)
 {
   WnckWindow        *active_window;
+  WnckClassGroup    *class_group = NULL;
   GList             *li;
   XfceTasklistChild *child;
 
@@ -1661,12 +1662,32 @@ xfce_tasklist_active_window_changed (WnckScreen   *screen,
 
       /* update timestamp for window */
       if (child->window == active_window)
-        g_get_current_time (&child->last_focused);
+        {
+          g_get_current_time (&child->last_focused);
+          /* the active window is in a group, so find the group button */
+          if (child->type == CHILD_TYPE_GROUP_MENU)
+            {
+              class_group = child->class_group;
+            }
+        }
 
       /* set the toggle button state */
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (child->button),
                                     !!(child->window == active_window));
     }
+  /* set the toggle button state for the group button */
+  if (class_group)
+    {
+      for (li = tasklist->windows; li != NULL; li = li->next)
+      {
+        child = li->data;
+        if (child->type == CHILD_TYPE_GROUP
+          && child->class_group == class_group)
+          {
+            gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (child->button), TRUE);
+          }
+      }
+    }
 
   /* release the lock */
   xfce_taskbar_unlock (tasklist);

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


More information about the Xfce4-commits mailing list