[Xfce4-commits] [xfce/xfce4-panel] 01/01: Revert "tasklist: Add support for larger application icons"

noreply at xfce.org noreply at xfce.org
Fri Dec 14 10:29: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 0df60dc8e4b6d3d007eea442cda464950b187218
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Fri Dec 14 10:27:32 2018 +0100

    Revert "tasklist: Add support for larger application icons"
    
    Unfortunately the global icon cache of libwnck lets us run into an
    "icon-changed" signal loop if a user has multiple tasklists with
    different icon sizes. This was already realized in 2002, when this call
    was originally removed from libwnck. It's unclear to me why it was
    re-introduced without addressing this issue.
    For reference:
     * https://github.com/GNOME/libwnck/commit/4b216137230d2fac212b42b42acb8267e604c0a7
    
    This reverts commit fc4efcc991b21d191f0b82412fb33070009780c5.
---
 configure.ac.in                    |  2 +-
 plugins/tasklist/tasklist-widget.c | 33 ++++++---------------------------
 2 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/configure.ac.in b/configure.ac.in
index 31604c3..04f42b5 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -152,7 +152,7 @@ XDT_CHECK_PACKAGE([GIO], [gio-2.0], [2.24.0])
 PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0 >= 2.24.0])
 XDT_CHECK_PACKAGE([GMODULE], [gmodule-2.0], [2.24.0])
 XDT_CHECK_PACKAGE([CAIRO], [cairo], [1.0.0])
-XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [3.4])
+XDT_CHECK_PACKAGE([LIBWNCK], [libwnck-3.0], [3.0])
 
 dnl ***********************************************************
 dnl *** Optional support for a GTK+2 version of the library ***
diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index dd30962..fd9476a 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -2568,12 +2568,13 @@ xfce_tasklist_button_icon_changed (WnckWindow        *window,
     return;
 
   icon_size = xfce_panel_plugin_get_icon_size (XFCE_PANEL_PLUGIN (xfce_tasklist_get_panel_plugin (tasklist)));
-  wnck_set_default_icon_size (icon_size);
   context = gtk_widget_get_style_context (GTK_WIDGET (child->icon));
 
   /* get the window icon */
-  if (tasklist->show_labels
-      || child->type == CHILD_TYPE_GROUP_MENU)
+  if (tasklist->show_labels ||
+      child->type == CHILD_TYPE_GROUP_MENU)
+    pixbuf = wnck_window_get_mini_icon (window);
+  else if (icon_size <= 31)
     pixbuf = wnck_window_get_mini_icon (window);
   else
     pixbuf = wnck_window_get_icon (window);
@@ -3743,12 +3744,13 @@ xfce_tasklist_group_button_icon_changed (WnckClassGroup    *class_group,
     return;
 
   icon_size = xfce_panel_plugin_get_icon_size (XFCE_PANEL_PLUGIN (xfce_tasklist_get_panel_plugin (group_child->tasklist)));
-  wnck_set_default_icon_size (icon_size);
   context = gtk_widget_get_style_context (GTK_WIDGET (group_child->icon));
 
   /* get the class group icon */
   if (group_child->tasklist->show_labels)
     pixbuf = wnck_class_group_get_mini_icon (class_group);
+  else if (icon_size <= 31)
+    pixbuf = wnck_class_group_get_mini_icon (class_group);
   else
     pixbuf = wnck_class_group_get_icon (class_group);
 
@@ -3756,13 +3758,6 @@ xfce_tasklist_group_button_icon_changed (WnckClassGroup    *class_group,
   for (li = group_child->windows; li != NULL; li = li->next)
     {
       child = li->data;
-      /* in case the libwnck icon_cache provided us with a 32px group icon and that's not
-         what we want we take the app icon of the first app in the group instead (only until
-         cache is invalidated of course), because we always get that at the correct size */
-      if (gdk_pixbuf_get_width (pixbuf) != icon_size
-          && !group_child->tasklist->show_labels)
-          pixbuf = wnck_window_get_icon (child->window);
-
       if (!wnck_window_is_minimized (child->window))
         {
           all_minimized_in_group = FALSE;
@@ -3791,20 +3786,6 @@ xfce_tasklist_group_button_icon_changed (WnckClassGroup    *class_group,
 
 
 
-static gboolean
-xfce_tasklist_group_button_size_allocate (GtkWidget         *widget,
-                                          GdkRectangle      *allocation,
-                                          gpointer           user_data)
-{
-  XfceTasklistChild *child = user_data;
-  /* Make sure the icons have the correct size */
-  xfce_tasklist_group_button_icon_changed (child->class_group, child);
-
-  return TRUE;
-}
-
-
-
 static void
 xfce_tasklist_group_button_remove (XfceTasklistChild *group_child)
 {
@@ -3983,8 +3964,6 @@ xfce_tasklist_group_button_new (WnckClassGroup *class_group,
   /* note that the same signals should be in the proxy menu item too */
   g_signal_connect (G_OBJECT (child->button), "button-press-event",
       G_CALLBACK (xfce_tasklist_group_button_button_press_event), child);
-  g_signal_connect (G_OBJECT (child->button), "size-allocate",
-      G_CALLBACK (xfce_tasklist_group_button_size_allocate), child);
 
   /* monitor class group changes */
   g_signal_connect (G_OBJECT (class_group), "icon-changed",

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


More information about the Xfce4-commits mailing list