Remove roundtrip to XServer from Workspace::xStackingOrder Introduce a method Workspace::markXStackingOrderAsDirty
ClosedPublic

Authored by graesslin on Jun 21 2017, 7:18 PM.

Details

Summary

This method replaces the calls x_stacking_dirty = true in the code base
allowing for further refactoring of that functionality.

Remove roundtrip to XServer from Workspace::xStackingOrder

The method xStackingOrder is only used during a Compositor paint pass.
If the stacking order had changed, the method updated the stacking order
from X by performing a sync XQueryTree. With other words we had a round
trip to the X server directly in the paint pass.

This change rearchitectures this area by making better use of xcb. When
we notice that the stacking order changed and an XQueryTree is needed,
we directly send out the request. When xStackingOrder is finally called,
which normally happens a few milliseconds later, the reply is retreived.
In the worst case it still blocks, but in most cases the roundtrip is
gone.

If the stacking order changed again before accessing xStackingOrder the
running request is cancelled and a new request is issued. So whenever we
get into xStackingOrder it will have the current state.

The updating of the xStackingOrder is moved into a dedicated method and
xStackingOrder invokes it through a const_cast instead of operating on
mutable variables.

Test Plan

Normal system usage, no issues

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin created this revision.Jun 21 2017, 7:18 PM
Restricted Application added a project: KWin. · View Herald TranscriptJun 21 2017, 7:18 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
mart accepted this revision.Jun 22 2017, 1:28 PM
This revision is now accepted and ready to land.Jun 22 2017, 1:28 PM
This revision was automatically updated to reflect the committed changes.