Review Request: Fix taskmanager's "by desktop" sorting mode
Aaron Seigo
aseigo at kde.org
Tue Mar 30 03:30:58 CEST 2010
> On 2010-03-29 18:34:53, Aaron Seigo wrote:
> > trunk/KDE/kdebase/workspace/libs/taskmanager/strategies/desktopsortingstrategy.cpp, lines 59-71
> > <http://reviewboard.kde.org/r/3375/diff/3/?file=21852#file21852line59>
> >
> > all of the winIds() stuff can be gotten rid of now that there is the id() method. if winIds().isEmpty(), then desktop() is going to be 0. and since the winIds() list isn't beig used, then it's probably enough to just do this:
> >
> > const int leftDesktop = left->desktop();
> > const int rightDesktop = right->desktop();
> > if (leftDesktop() == rightDesktop) {
> > return left->id() < right->id();
> > }
> >
> > return leftDesktop < rightDesktop;
>
> Dmitry Suzdalev wrote:
> This really should work, but it doesn't. Exactly startup items pose the problem:
>
> if they are not in the end of the *whole* list, then tasks layouting class
> 1) Sees that some new task (start up one) appeared in the middle of the list and rearranges the items, reassigning their indexes
> 2) At the same time it tries to keep "startup items" in the end, and because of this user observes "strange" moves of tasks in the middle, while startup ones are still in the end (visually).
>
> Putting startup tasks explicitly in the end of the list and ensuring they'll always be there solves these problems.
>
> But I guess the real fix should be in layouting classes in tasks applet, but it's source is not so trivial, I need to study the code more.
> So perhaps it'll need to wait to fix this in the right place.
> I'll try to dig in and report when done :)
perhaps a more straightforward solution would be to add a virtual bool isStartupItem() to AbstractGroupableItem. the default impl would return false, and the reimp in TaskItem would just be "return d->startupPtr;"?
so then it would be something like:
if (left->isStartup()) {
if (right->isStartup()) {
return left->name().toLower() < right->name().toLower();
}
return false;
}
if (right->isStartup()) {
return true;
}
const int leftDesktop = left->desktop();
const int rightDesktop = right->desktop();
if (leftDesktop() == rightDesktop) {
return left->id() < right->id();
}
return leftDesktop < rightDesktop;
- Aaron
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3375/#review4747
-----------------------------------------------------------
On 2010-03-29 17:08:22, Dmitry Suzdalev wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3375/
> -----------------------------------------------------------
>
> (Updated 2010-03-29 17:08:22)
>
>
> Review request for Plasma.
>
>
> Summary
> -------
>
> This patch fixes a sorting order for "Sort by Desktop" mode of taskmanager lib.
>
> Summary:
> 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 https://bugs.kde.org/show_bug.cgi?id=219528 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.
> https://bugs.kde.org/show_bug.cgi?id=219528
>
>
> Diffs
> -----
>
> 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
>
> Diff: http://reviewboard.kde.org/r/3375/diff
>
>
> Testing
> -------
>
> 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"
>
>
> Thanks,
>
> Dmitry
>
>
More information about the Plasma-devel
mailing list