[libtaskmanager] Track stacking order and window activation (on X11)
ClosedPublic

Authored by hein on Jun 23 2019, 4:44 PM.

Details

Summary

TaskGroupingProxyModel::requestToggleMaximized now uses this to
minimize and restore groups of windows while preserving the
stacking order, a frequently user-requested wish.
BUG:368867

Window activation is additionally tracked to implement a new front-
end feature to activate the most recently active window (or fall
through to stacking order otherwise) subsequently.
CCBUG:370258

A Wayland implementation requires the addition of a
PlasmaWindowManagement::stackingOrder(), which should be a QList
of PlasmaWindow* in stacking order, along with a change signal. We
discussed this at the Plasma+KWin sprint and I'll code up patches
to KWin and KWayland soon and then implement the new API in here.

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 13234
Build 13252: arc lint + arc unit
hein created this revision.Jun 23 2019, 4:44 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 23 2019, 4:44 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein requested review of this revision.Jun 23 2019, 4:44 PM
ngraham edited the summary of this revision. (Show Details)Jun 26 2019, 1:00 PM
anthonyfieroni added inline comments.
libtaskmanager/xwindowtasksmodel.cpp
673–675

That's double lookup in intensive called function, what about

int idx = d->lastActivated.indexOf(window);
if (idx >= 0)
     return d->lastActivated.at(idx);
pino added a subscriber: pino.Jun 26 2019, 6:45 PM
pino added inline comments.
libtaskmanager/xwindowtasksmodel.cpp
673–675

@anthonyfieroni d->lastActivated is a QHash, so your suggestion does even build. OTOH, using iterators will do it.

One minor comment, and anthonyfieroni's comment, and this is good to go.

libtaskmanager/xwindowtasksmodel.cpp
203

if (rowCount > 0) {

}

otherwise you emit data changed for an invalid index. I think it could happen as stacking order includes some windows not listed here and we have the xwindowsystemeventbatcher

This revision was not accepted when it landed; it landed in state Needs Review.Nov 25 2019, 6:54 PM
This revision was automatically updated to reflect the committed changes.