! 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 !
Visual feedback for grouped windows in the panel (tasklist windows buttons pl...
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-panel
Component:
Window Buttons

Comments

Description amigamagic 2014-04-24 21:19:38 CEST
Created attachment 5451 
diff file for tasklist-widget.c

package: xfce4-panel-4.11.0
plugin: tasklist

When you configure your tasklist plugin to "ALWAYS GROUP" the windows and to NOT SHOW button labels, the current implementation of the plugin doesn't permit the user to distinguish between grouped icons and no-grouped ones. 

Most of other taskbar/dockbar tools give some visual feedback to the user to let him know that there are more instances of the same application open.

So, I modded the tasklist plugin to show a little number near the icon of a grouped one when you select to always group the window buttons and to hide the labels. With this mod, the user always knows immediately if an icon represents a "single" window or a "group" of windows.

I spent much time to solve little but tedious alignment problems in various configurations of the panel, like the horizontal and deskbar modes, and multi-rows. Maybe it's not perfect, it's not eye-candy, but I think it does its job pretty well.

This mod works with every panel size, but it works best with a panel size of 40 pixel in height (if it's horizontal). 

Note that this patch get rid of a little bug in the current tasklist plugin implementation. Here is the description of the bug: 

- from a default panel configuration, try to select the following options in the properties:

1) Window grouping: ALWAYS
2) Show button labels: UNCHECK

after that the grouped icons (and only them) will be incorrectly rendered in their "mini" version (you can see that more easily if you have a bigger panel size). With this patch, the problem is fixed. :-)

Let me know what do you think of this patch and feel free to use it or improve it. 

Cheers,
amigamagic
Comment 1 Landry Breuil editbugs 2014-04-24 21:44:24 CEST
While i support the general idea and tested this on top of 4.10 branch, this has some glitches:
- it makes the icons in all the buttons smaller
- and the button for the group is not square anymore..

attaching screenshot for both cases.
Comment 2 Landry Breuil editbugs 2014-04-24 21:44:53 CEST
Created attachment 5452 
default 4.10 tasklist
Comment 3 Landry Breuil editbugs 2014-04-24 21:46:57 CEST
Created attachment 5453 
with the patch, icons grouped
Comment 4 Landry Breuil editbugs 2014-04-24 21:48:54 CEST
Created attachment 5454 
with the patch, icons ungrouped
Comment 5 amigamagic 2014-04-24 22:35:57 CEST
(In reply to Landry Breuil from comment #1)
> While i support the general idea and tested this on top of 4.10 branch, this
> has some glitches:
> - it makes the icons in all the buttons smaller
> - and the button for the group is not square anymore..
> 
> attaching screenshot for both cases.

The icons are smaller because in your scenario you used a panel size smaller than 38 pixel. In this case, my code actually switches the icons to their "mini" versions, because of various (tedious) alignment problems when the "normal-size" icons had to be scaled to smaller versions. So I preferred to not scale them at all, and switch them with their minimized versions when the panel size is set at a value less than 38 pixel.

For the second problem you talk about... I don't understand what you mean...
Comment 6 Landry Breuil editbugs 2014-04-24 23:02:00 CEST
If you look at the screenshot with the grouped icon, the grouped button has less width than other buttons (agreed, since the buttons are set flat you dont see their border but you see the space between others) - not square anymore, ie rectangle.
Comment 7 amigamagic 2014-04-25 00:40:12 CEST
(In reply to Landry Breuil from comment #6)
> If you look at the screenshot with the grouped icon, the grouped button has
> less width than other buttons (agreed, since the buttons are set flat you
> dont see their border but you see the space between others) - not square
> anymore, ie rectangle.

That's strange... On my PC they appear to have nearly the same size. It's true that they are not squared because I had to accomodate space for the little number to the bottom right. 

Maybe the best solution would be to have a "badge" style number that could "overlap" on the icon, so that I should not worry anymore for alignment troubles and we could have squared icons for the grouped ones too (but honestly, I don't care much if the icon buttons are perfectly square or not). Unfortunately, I'm not a GTK expert, so I should need some help for the overlapping thing...
Comment 8 amigamagic 2014-04-26 13:34:50 CEST
Created attachment 5457 
diff file for tasklist-widget.c (v2)

Fixes to the previous patch:
- Now the icons are properly scaled when the panel size ranges from 16 to 40 pixel.
- Fixed some issues reported by Landry Breuil and other little alignment issues with icons and labels.

Note: it appears that the current implementation of "wnck_window_get_icon" doesn't get icons larger than 32x32 pixels, so it's not advisable to use panel sizes bigger than ~40 pixel, being that the icons in the tasklist will always keep their 32x32 default size.
Comment 9 Simon Steinbeiss editbugs 2018-11-29 18:11:26 CET
I've rebased this patch on top of current master, but I still see at least one issue I would like to fix before merging this:
- when a single window is minimized and you then open a second window of that application, the icon remains 70% translucent, so there's at least one unhandled signal/case (active_window_changed or whatever)
- the exo stuff should be replaced by style-classes and something like "button image { opacity: 0.7; }"
Comment 10 Simon Steinbeiss editbugs 2018-11-30 16:47:40 CET
Whoopsie, disregard my last comment, it was directed at https://bugzilla.xfce.org/show_bug.cgi?id=10862

In any case, I'll be looking into re-basing this patch on top of master as well. Wouldn't mind help of course ;)
Comment 11 Simon Steinbeiss editbugs 2018-12-03 23:59:47 CET
This is somewhat enabled now, but it depends on the Gtk+ theme to actually implement this visual distinction:
https://git.xfce.org/xfce/xfce4-panel/commit/?id=971188bec9a1336db42492ce32f9a4ad7ecd7f0e

I'll probably do that in Greybird soon.
Comment 12 Simon Steinbeiss editbugs 2019-06-27 01:13:24 CEST
Created attachment 8690 
Precondition for patch
Comment 13 Simon Steinbeiss editbugs 2019-06-27 01:15:24 CEST
Created attachment 8691 
Actual patch

Here's a patch that achieves the desired result with cairo.
Comment 14 Git Bot editbugs 2019-06-29 00:15:41 CEST
Simon Steinbeiss referenced this bugreport in commit 36bc57e035e0e356e3d59d7442adcdd05884d5c8

tasklist: Draw grouped windows count indicator (Bug #10844)

https://git.xfce.org/xfce/xfce4-panel/commit?id=36bc57e035e0e356e3d59d7442adcdd05884d5c8

Bug #10844

Reported by:
amigamagic
Reported on: 2014-04-24
Last modified on: 2019-07-15

People

Assignee:
Simon Steinbeiss
CC List:
2 users

Version

Version:
4.10.1

Attachments

diff file for tasklist-widget.c (8.20 KB, patch)
2014-04-24 21:19 CEST , amigamagic
no flags
default 4.10 tasklist (6.01 KB, image/png)
2014-04-24 21:44 CEST , Landry Breuil
no flags
with the patch, icons grouped (3.21 KB, image/png)
2014-04-24 21:46 CEST , Landry Breuil
no flags
with the patch, icons ungrouped (3.79 KB, image/png)
2014-04-24 21:48 CEST , Landry Breuil
no flags
diff file for tasklist-widget.c (v2) (9.90 KB, patch)
2014-04-26 13:34 CEST , amigamagic
no flags
Precondition for patch (769 bytes, patch)
2019-06-27 01:13 CEST , Simon Steinbeiss
no flags
Actual patch (7.40 KB, patch)
2019-06-27 01:15 CEST , Simon Steinbeiss
no flags

Additional information