Review Request: Fix taskmanager's "by desktop" sorting mode

Dmitry Suzdalev dimsuz at
Mon Mar 29 19:08:22 CEST 2010

This is an automatically generated e-mail. To reply, visit:

(Updated 2010-03-29 17:08:22.316461)

Review request for Plasma.


Added an id() method to AbstractGroupableItem class which assigns a new int-based id to each new instance of the class.
New id is based on a static field inside AbstractGroupableItem.

Also note that winIds() stuff inside comparison function is still needed to correctly sort out startup tasks to the end of the list.
If it won't be done, they'll spoil the party because having startup items in the middle of the list confuses layouting algorithm and 
makes the items "jump" as they get clicked.


This patch fixes a sorting order for "Sort by Desktop" mode of taskmanager lib.

When in "Sort by Desktop" mode, sort by_desktop+by_winId, instead of by_desktop+by_winTitle as it is now.

More details:
Currently in "by desktop" sorting mode tasks are sorted by desktop and then by name.
This leads to inconvenient things, here are some examples:

- I have a browser with several tabs open. Whenever I change a tab, browser changes window title.
This makes task jump in a task bar from one position to another while I'm simply changing tabs.
- I have a 'konsole' window and as I do 'cd onedir', 'cd zletter_dir', etc, title is changed, task jumps
- Some other situations caused this too, don't recall, but you got the idea :)

What I've done:
Instead of sorting by name, i made it to sort by winId. Tasks without winId are sorted out to the end of the list
and sorted by name there. Typically these are the startup-in-progress items.

As a side effect this fixes bug which has the same roots:
invalid sorting order due to wrong comparison of regular items with "starting up" items.

Long description, short patch ;)

This addresses bug 219528.

Diffs (updated)

  trunk/KDE/kdebase/workspace/libs/taskmanager/abstractgroupableitem.h 1105271 
  trunk/KDE/kdebase/workspace/libs/taskmanager/abstractgroupableitem.cpp 1105271 
  trunk/KDE/kdebase/workspace/libs/taskmanager/strategies/desktopsortingstrategy.cpp 1105271 



Tested on trunk. Task items retain their sort order, not reacting to title changes, charming :)

It affects only task applets with sort mode set to "by desktop"



More information about the Plasma-devel mailing list