! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Tasklist operations on groups
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-panel

Comments

Description Jorge Rodríguez 2007-09-22 16:36:04 CEST
Hello,

I'm not sure this bug report/patch should be included in this category. It's a patch for libxfcegui4 but affects to tasklist plugin.

The patch adds three new entries in the task popup menu:

* Active group (raises all windows in the group)
* Minimize group.
* Close group.

---%<---%<---%<---%<---%<---

diff -Naubr libxfcegui4.orig/libxfcegui4/netk-tasklist.c libxfcegui4/libxfcegui4/netk-tasklist.c
--- libxfcegui4.orig/libxfcegui4/netk-tasklist.c	2007-09-22 18:03:31.000000000 +0200
+++ libxfcegui4/libxfcegui4/netk-tasklist.c	2007-09-22 18:15:27.000000000 +0200
@@ -188,6 +188,9 @@
 static GdkPixbuf *netk_task_get_icon (NetkTask * task);
 static gint netk_task_compare (gconstpointer a, gconstpointer b);
 static void netk_task_update_visible_state (NetkTask * task);
+static void netk_task_activate_all (GtkMenuItem *raise_g, gpointer * data);
+static void netk_task_minimize_all (GtkMenuItem *minim_g, gpointer * data);
+static void netk_task_close_all (GtkMenuItem *close_g, gpointer * data);
 
 
 static void netk_tasklist_init (NetkTasklist * tasklist);
@@ -1784,6 +1787,52 @@
         l = l->next;
     }
 
+    if (action_submenu)
+    {
+        GtkWidget *raise_g, *close_g, *minim_g, *image;
+
+        menu_item = gtk_menu_item_new (); /* separator */
+        raise_g = gtk_image_menu_item_new_with_label (_("Active group"));
+        minim_g = gtk_image_menu_item_new_with_label (_("Minimize group"));
+        close_g = gtk_image_menu_item_new_with_label (_("Close group"));
+
+        image = gtk_image_new_from_stock (NETK_STOCK_UNMINIMIZE,
+                                          GTK_ICON_SIZE_MENU);
+        gtk_widget_show (image);
+        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (raise_g), image);
+
+        image = gtk_image_new_from_stock (NETK_STOCK_MINIMIZE,
+                                          GTK_ICON_SIZE_MENU);
+        gtk_widget_show (image);
+        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (minim_g), image);
+
+        image = gtk_image_new_from_stock (NETK_STOCK_DELETE,
+                                          GTK_ICON_SIZE_MENU);
+        gtk_widget_show (image);
+        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (close_g), image);
+
+        gtk_widget_show (menu_item);
+        gtk_widget_show (raise_g);
+        gtk_widget_show (minim_g);
+        gtk_widget_show (close_g);
+
+        g_signal_connect_object (G_OBJECT (raise_g), "activate",
+                                 G_CALLBACK (netk_task_activate_all),
+                                 task, 0);
+
+        g_signal_connect_object (G_OBJECT (minim_g), "activate",
+                                 G_CALLBACK (netk_task_minimize_all),
+                                 task, 0);
+        g_signal_connect_object (G_OBJECT (close_g), "activate",
+                                 G_CALLBACK (netk_task_close_all),
+                                 task, 0);
+
+        gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item);
+        gtk_menu_shell_append (GTK_MENU_SHELL (menu), raise_g);
+        gtk_menu_shell_append (GTK_MENU_SHELL (menu), minim_g);
+        gtk_menu_shell_append (GTK_MENU_SHELL (menu), close_g);
+    }
+
     gtk_menu_set_screen (GTK_MENU (menu), xfce_gdk_display_locate_monitor_with_pointer (NULL, NULL));
     gtk_widget_show (menu);
     gtk_menu_popup (GTK_MENU (menu), NULL, NULL, netk_task_position_menu,
@@ -1791,6 +1840,42 @@
 }
 
 static void
+netk_task_activate_all (GtkMenuItem * raise_g, gpointer * data)
+{
+    GList *l = NETK_TASK (data)->windows;
+
+    while (l)
+    {
+        netk_window_activate (NETK_TASK (l->data)->window);
+        l = l->next;
+    }
+}
+
+static void
+netk_task_minimize_all (GtkMenuItem * minim_g, gpointer * data)
+{
+    GList *l = NETK_TASK (data)->windows;
+
+    while (l)
+    {
+        netk_window_minimize (NETK_TASK (l->data)->window);
+        l = l->next;
+    }
+}
+
+static void
+netk_task_close_all (GtkMenuItem * close_g, gpointer * data)
+{
+    GList *l = NETK_TASK (data)->windows;
+
+    while (l)
+    {
+        netk_window_close (NETK_TASK (l->data)->window);
+        l = l->next;
+    }
+}
+
+static void
 netk_task_button_toggled (GtkButton * button, NetkTask * task)
 {
     /* Did we really want to change the state of the togglebutton? */
Comment 1 Jorge Rodríguez 2007-09-22 16:40:57 CEST
Created attachment 1367 
Patch for operations on groups support

Ops, I didn't know I can attach files, sorry :-)
Comment 2 Nick Schermer editbugs 2007-09-22 19:37:25 CEST
We're going to switch to libwnck soon, so you can post the ideas/patch in Gnome's bugzilla.
Comment 3 Jorge Rodríguez 2007-09-22 23:46:53 CEST
Thanks for reply,

(In reply to comment #2)
> We're going to switch to libwnck soon, so you can post the ideas/patch in
> Gnome's bugzilla.

Sadly it is not a 'Gnome HIG compliant' feature I think, and in adition It's only useful with 'Always group tasks' option turned on and apps like The Gimp or something else. I'm afraid it's 'wontfix' here and there :-)

Ah, I want too congratulate you and the Xfce team for all your efforts and hard work. Xfce is a great!
Comment 4 Nick Schermer editbugs 2008-06-26 10:43:16 CEST
Gnome has this in wnck IIRC. Closing.

Bug #3564

Reported by:
Jorge Rodríguez
Reported on: 2007-09-22
Last modified on: 2010-11-20

People

Assignee:
Nick Schermer
CC List:
0 users

Version

Version:
4.7 (master)

Attachments

Patch for operations on groups support (3.90 KB, patch)
2007-09-22 16:40 CEST , Jorge Rodríguez
no flags

Additional information