After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 171804 - Window list grouped sorting
Window list grouped sorting
Status: RESOLVED OBSOLETE
Product: libwnck
Classification: Core
Component: tasklist
2.10.x
Other All
: High minor
: ---
Assigned To: libwnck maintainers
libwnck maintainers
: 53942 366752 593730 (view as bug list)
Depends on:
Blocks: 155904
 
 
Reported: 2005-03-27 18:14 UTC by Peter Oliver
Modified: 2018-01-24 13:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
that does the job (1.73 KB, patch)
2005-07-24 19:55 UTC, Xavier Claessens
none Details | Review
thanks Vincent (1.72 KB, patch)
2005-08-18 19:35 UTC, Xavier Claessens
committed Details | Review
tasklist: make sure windows in groups are sorted consistently (1.24 KB, patch)
2011-03-03 15:23 UTC, Ray Strode [halfline]
none Details | Review
tasklist: add new sort policy for windows in groups (7.94 KB, patch)
2011-03-03 15:23 UTC, Ray Strode [halfline]
none Details | Review
wncklet: Add new sorting option for window list groups (11.85 KB, patch)
2011-03-03 15:24 UTC, Ray Strode [halfline]
none Details | Review

Description Peter Oliver 2005-03-27 18:14:55 UTC
The window list sorts items in the order they were opened.  Seems reasonable.

Now, when a large number of windows are opened, it starts grouping related
items.  If someone has enough windows open to cause grouping, they probably have
a lot of windows.  It might be better to sort alphabetically within the groups.  

For example, I tend to open dozens of xterms across many different hosts.  I put
the hostname in the window title, but even so, finding the one I want is tricky.

Alphabetically sorting in general wouldn't be good because, for example, the
user wouldn't know where to expect a new item to appear in the window list, but
by grouping windows you're already breaking this ordering.  Changing the order
within the group wouldn't make much difference from this point of view.


Other information:
Comment 1 Elijah Newren 2005-03-27 22:38:26 UTC
*** Bug 53942 has been marked as a duplicate of this bug. ***
Comment 2 Xavier Claessens 2005-07-24 19:55:04 UTC
Created attachment 49691 [details] [review]
that does the job

i'm comparing with g_ascii_strcasecmp() beacause I don't find something like
g_utf8_strcasecmp().
Comment 3 Xavier Claessens 2005-07-24 19:55:59 UTC
priority=high because of the patch
Comment 4 Vincent Untz 2005-08-18 19:26:24 UTC
Xavier: I think you need to use g_utf8_collate().
Comment 5 Xavier Claessens 2005-08-18 19:35:44 UTC
Created attachment 50947 [details] [review]
thanks Vincent

done
Comment 6 Vincent Untz 2005-12-19 18:18:46 UTC
Thanks Xavier. I committed a slightly modified version (there was a leak ;-)).
Comment 7 Liam Quin 2006-05-02 13:11:12 UTC
I turns out that this behaviour (sorting) is a real pain, because window titles change dynamically.

My terminal title changes when I change directory (or perhaps if someone changes the topic in a text-based IRC client, or if I edit a file in an editor, or...).

My Web browser window changes title if I switch tabs, or if the page reloads, or if there's JavaScript that sets the title.

So now my windows move about in the grouped list, but not under my control, like wriggling maggots in a can, and I can't find the one I want.  Worse, the only way I can find a browser tab that's not displayed is by remembering its position in the list.  So now I have to go through all the windows until I find the one I need (or just open a new copy, which eventually crashes the browser).

To make this work, it needs either to have a preference to enable/disable on a per-application basis (which I think is crack) or to number windows when created, or to let users edit the displayed title (also crack, but it would belong in the window manager).

I've been trying to live with it, but it's really not working.  I don't want to stop using gnome-terminal and tabbed browsing.

I think it's best reverted.

Liam
Comment 8 Elijah Newren 2006-05-02 13:43:49 UTC
Reopening as per Liam's comments.
Comment 9 Benjamin Otte (Company) 2006-06-17 09:09:50 UTC
I'm very in favour of alphabetic sorting because I use the same apps most of the time and no matter in which order I open them, they always appear in the same order in the Tasklist. (XChat always last for example)
From my understanding it would be necessary to find a sorting algorithm that sorts windows the same all the time. So it would be necesary to sort by an immutable (ideally across sessions) property.
Are there any useful immutable properties that could be sorted on? The best I can come up with right now is the name of the executable that created the window.
Comment 10 Giovanni Corriga 2007-06-05 08:00:00 UTC
I'm with Liam on this one. The order should be reverted to opening time, since IMHO it's the only sensible one. If I want to switch back to, say, the second Firefox window I opened, I expect to find it near the top of the window group list, etc. etc.
Comment 11 Vincent Untz 2007-06-19 11:31:04 UTC
*** Bug 366752 has been marked as a duplicate of this bug. ***
Comment 12 Vincent Untz 2007-06-19 11:32:08 UTC
In bug 366752, Elijah mentioned he would probably revert this.
Comment 13 Michal Rehak 2007-08-02 19:17:13 UTC
It looks like both sortings are usefull depending on user approach. So to satisfy both groups it would be best to include both types and add option to switch between them (in gconf for start).
From implementation point of view, if I understand it right, there is already working code for both sortings. What needs to be done is put both code pieces together in one revision and add code to decide acording to user setting which sorting will be used, right?
I do not care which sorting will be set as default, as long as I can change it.:-)
Comment 14 Joona Palaste 2007-08-02 19:41:10 UTC
(In reply to comment #13)
> It looks like both sortings are usefull depending on user approach. So to
> satisfy both groups it would be best to include both types and add option to
> switch between them (in gconf for start).
> From implementation point of view, if I understand it right, there is already
> working code for both sortings. What needs to be done is put both code pieces
> together in one revision and add code to decide acording to user setting which
> sorting will be used, right?
> I do not care which sorting will be set as default, as long as I can change
> it.:-)
> 

This sounds like exactly what I was asking for. If the selection can be done with a GUI, that's all the better. Otherwise I can settle for writing a value in some configuration file, as long as I don't have to recompile the actual Gnome Panel sources.
Comment 15 Grondr 2007-11-08 04:41:35 UTC
So, has the ability to NOT sort alphabetically been added in any way?  I just tried booting Gutsy (and I'm not sure how to tell which of the various patches to this might be in that release), and it has the following behavior:
(a) No grouping, unless I find the relevant UI switch and throw it.  I can live with that, by leaving the switch thrown.  (I don't recall the name of that switch, since I booted a LiveCD a few days ago when I was playing with this.)
(b) Windows are STILL sorted alphabetically!  And I can't find any way to turn this off.  I've been waiting for this alphabetical-sorting to be reverted for about two years now (it was okay in Hoary, and all Ubuntu releases since then have had the involuntary sorting), and I'd really love to stop waiting...

Thanks!
Comment 16 id 2008-06-22 20:19:28 UTC
yep... now in Ubuntu Hardy, I decided that since I have about 50 windows up, I might as well group them -- but now that they're all sorted alphabetically per application, I can't find e.g. which Firefox window I need.  progress, please? :-)
Comment 17 Vincent Untz 2009-08-31 23:04:36 UTC
*** Bug 593730 has been marked as a duplicate of this bug. ***
Comment 18 Grondr 2009-10-27 09:11:40 UTC
For the love of god, can we PLEASE get this reverted back to the FOUR-YEAR-OLD behavior of NOT alphabetically sorting?

I'm sorry to shout, but consider the history here:
(a) Change made 4 years ago.
(b) People affected 3-4 years ago as it came downstream.  I and others complained at that time, in this and other bugs.
(c) Agreement reached 2 years ago that this was a bad idea and should be reverted.

Since then, NOTHING.  Its priority is currently "High" but the reversion has not happened.  I've been waiting patiently---probably too patiently---for someone to finally have the time to deal with this---should I have been sending a ping every 2 months instead?

I am -weeping- with frustration over this issue.  This issue, almost singlehandedly, has kept me running a four-year-old release (Hoary, 5.04) on my primary desktop, because having all of my windows sorted alphabetically is just intolerable.  (I'm surviving by using forwarded X connections from newer releases to the old desktop.)  Now, I -must- leave this ancient, ancient release, and am quite disappointed to find that even in the Ubuntu coming out in two days, the Gnome shipping with it still has this ill-advised change---which was marked for reversion two years ago!

So, two requests:
(a) Please, PLEASE revert the alphabetical sorting!
(b) Since nothing you do can possibly trickle downstream to what I'm running for 6-12 months at this rate, some guidance on how to recompile wnck-applet and/or all of Gnome so I can kill this modification dead would be very, very appreciated.  I -hate- the idea of having to run my own build of any part of the window system (since I'll have to pin that and won't be able to accept automatic updates---grrr), but it's better than the current behavior.

Please?

P.S.  The actual patch that started all this is an attachment to this ticket, so if I can figure out what build-deps I need to make the minimally-intrusive recompilation to undo it on my machine, that'd be grand.  Lots more discussion about this problem is in bug 366752, which was marked as a duplicate of this bug.

Thank you!
Comment 19 Grondr 2009-10-28 04:20:10 UTC
Okay, I finally broke down and just made this patch for myself; it turned out to be -way- easier than I thought.  (But this should still be reverted here! :)

For the benefit of the others following this bug, here's what I did.  This was in the Ubuntu Karmic beta on AMD64; you'll have to change the amd64 to i383 if that's your architecture, and make slight changes to version numbers, etc.

apt-get install build-essential bzr
apt-get build-dep libwnck
sudo apt-get build-dep libwnck
bzr get https://code.launchpad.net/~ubuntu-desktop/libwnck/ubuntu
apt-get source libwnck

Then edit libwnck/tasklist.c (currently around lines 1552-3) to comment-out the class_group_task->windows = g_list_sort () stuff (you're reversing the effect of the patch in the attachment to this ticket, but not bothering to undefine the function; that'll give you a harmless compilation warning if you're paying attention).

Then:

debchange -v 1:2.28.0-0ubuntu1+nosorting
debuild -rfakeroot binary
cd ..
sudo dpkg -i libwnck-common_2.28.0-0ubuntu1+nosorting_all.deb libwnck22_2.28.0-0ubuntu1+nosorting_amd64.deb
killall gnome-panel

To test:

for x in $(seq 1 15); do xterm -n $x & done

and note how your window names are now in probably random numerical order (they'd be in numerical order if there was a sleep in there :), and not instead sorted 1 11 12 13 14 15 2 3 4 5 etc.  (You'll have to turn on grouping of course by right-clicking in the little widget at the left of the taskbar, since that's what this is fixing).

I haven't actually checked to see if the bzr call above contributed any source-code mods that weren't picked up in what I was doing.

(The debchange will keep apt-get etc from bugging you about your private package.)

Bliss!
Comment 20 Grondr 2009-10-28 04:21:21 UTC
(Oops---watch out for the linewrap in the dpkg command above.)
Comment 21 Ray Strode [halfline] 2011-03-03 15:23:40 UTC
Created attachment 182351 [details] [review]
tasklist: make sure windows in groups are sorted consistently

Right now, they are sorted by age in some parts of the code and
sorted alphabetically in other parts.  The desired default
(alphabetical ordering) always seems to "win", so we may want to
drop the code that sorts it the other way entirely, but for now
at least make both places consistent.
Comment 22 Ray Strode [halfline] 2011-03-03 15:23:56 UTC
Created attachment 182352 [details] [review]
tasklist: add new sort policy for windows in groups

Right now the tasklist always sorts grouped windows
alphabetically.  This commit adds a new policy
"by age" which sorts things in the same order they
show up ungrouped.
Comment 23 Ray Strode [halfline] 2011-03-03 15:24:27 UTC
Created attachment 182353 [details] [review]
wncklet: Add new sorting option for window list groups

Right now window list groups sort their windows alphabetically.
This commit adds a new option to the panel preferences
to change the sorting behavior to the same behavior as
ungrouped windows.
Comment 24 Ray Strode [halfline] 2011-03-03 15:43:10 UTC
I talked to Vincent about this bug a few months ago and he said he was okay with adding a preference here (and I just now got an opportunity to work on it).

We have a RHEL customer who's very interested in seeing this get changed.  Of course, it may not be as relevant anymore in GNOME 3.
Comment 25 Ray Strode [halfline] 2011-03-03 17:48:51 UTC
(I just wanted to add that these patches are derived from some work initiated by Sean Lee <slee@redhat.com>)
Comment 26 GNOME Infrastructure Team 2018-01-24 13:26:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/libwnck/issues/44.