Plasma 5.8: More efficient Pager and Activity Pager widgets

On the heels of the Plasma 5.7's new Task Manager backend, the upcoming Plasma 5.8 LTS release will sport substantially rewritten Pager and Activity Pager widgets, aimed at improving efficiency and conserving resources in a typical Plasma Desktop setup.

Plasma Pager widget
Enemy located

Two birds with one stone

Both the Task Manager and Pager widgets report on the windowing system. (If you didn't know: The Pager is the little game-like minimap to the left of the Task Manager, showing the windows on each virtual desktop.) To do so they need to know about the windows that exist and various things about them, such as their location (screen, desktop) and state (active, minimized). Up until now, the two would collect all of that data independently, sharing no code, and doing much of the same processing in response to changes. Plasma 5.8's Pager now shares a backend with the Task Manager (no matter how many instances of each applet you have), consolidating all the window information processing in the Plasma shell process in just one spot. This saves a whole bunch of CPU and memory, along with being less code to maintain!

Doing less is doing fast

The old Pager backend would toss out everything it knew about the current state of the windowing system every time any window changed in any way, causing everything the widget was showing to be torn apart and recreated from scratch - even when most of it didn't need to be touched at all. That's of course terribly inefficient, and the Task Manager's backend is fortunately much smarter. No more needless busywork.

Dropping weight

The way the Pager is actually drawn was cleaned up along the way, now using less CPU and memory, especially with the bare-bones default settings. Dragging a window on the Pager is now also much more efficient internally.

(Re-)joining forces

All of the above also applies to the Activity Pager widget - which used to be a lightly modified copy of the Pager's code, and now instead shares all of its code with its sibling. The two pagers remain separate entries in the Widget Explorer, but all further maintenance and development can now happen on a unified codebase.


Hi, it's nice to know that you're still thinking about optimizations and refactoring even though from the end-user perspective everything is working OK - not many (especially commercial vendors) care about improving the code architecture and design in such a way. It's what I noticed KDE devs in general are constantly being vigilant about, and that's one of the reasons I prefer KDE to any other DE out there (including environments that are a part of commercial OSes).
There is one scratch with pager that's still itching mind you - independent pagers per screen, on a multi-screen setup. Right now this is not supported, I assume in 5.8 it still won't be (?), and I've read about it not being that simple to implement, but are there any plans to make this a reality and can it be included in the roadmap somehow?

By btin at Wed, 09/07/2016 - 06:18

I think we can put that on the roadmap now, actually! The new backend is screen-aware - it has to be, because the Task Manager has a "Show only tasks from the current screen" option, which means it needs to know about the geometry of screens, the location of windows, and the location of the Task Manager. All the data is there; the Pager would now just have to tick on the filtering and adapt its scaling calculations to the current screen's geometry.

It's probably indeed too late for Plasma 5.8 sadly (feature freeze is soon upon us - I might still try, though), but I think this is very feasible at least for 5.9.

By eike hein at Wed, 09/07/2016 - 09:39

That would be great! I don't know what's the official procedure for this, but if there's an issue opened somewhere and it perhaps needs some votes to prioritize the feature, or something similar, just point to the link please :D

By btin at Wed, 09/07/2016 - 10:37

I had a look, and it turns out there's indeed a ticket:

By eike hein at Wed, 09/07/2016 - 11:21

Patch under review:

By eike hein at Fri, 09/09/2016 - 08:57

Ability to have actually independent workspaces per monitor would be nice too.

But i know we won't have that, at least not in X11, considering previous kwin developers stance on the issue.

By Schmellow at Wed, 09/07/2016 - 11:55

It's really not viable on X11 because the spec that WMs/apps/toolkits agree on just doesn't allow for it. On Wayland it could perhaps be reconsidered; we're in the process of designing the new APIs there, and are deliberately making them much more flexible and trying to avoid getting locked into a particular design as on X11 (e.g. no single integer ids for virtual desktops and so on). Time will tell!

By eike hein at Wed, 09/07/2016 - 11:59

For the reference, this is the corresponding issue:

By nidi at Thu, 09/08/2016 - 19:53

the biggest missing feature for me is just to make a mode for the pager that "transforms" it into a icon and calls the desktop grid effect
qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut ShowDesktopGrid
onclick. just like this windows 10 feature is

why? because this way it needs minimal space in a panel but thanks to kwin it will have all the features needed.

however its a good progress like it is right now and thats always good to see (: so thanks for you work! (:

By fabse at Thu, 09/08/2016 - 01:08

Exactly my thoughts!
And in the pager settings is already an option to toggle the behavior on click.

I would like to see those two added:
- Desktop Grid
- Present Windows - Current Desktop
(Taken from Active Screen Corners and Edges - Settings).

By richard at Wed, 09/14/2016 - 09:19