Traverse the stacking order backwards when switching between windows
ClosedPublic

Authored by zzag on Aug 28 2019, 8:56 AM.

Details

Summary

In order to pick the next client to activate we traverse the stacking
order from bottom to top and assign to each client a score. The client
with the best score will be activated next. Function that assigns score
bases its decisions purely on geometry. This may backfire if there are
couple maximized or fullscreen clients on the screen - we'll activate
the bottom-most client.

This change toggles direction we traverse the stacking order. If there
are several clients with an identical score, then prefer the top-most
client, the one that the user most likely sees at the moment.

BUG: 411356
FIXED-IN: 5.17.0

Test Plan

New tests pass.

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.
zzag created this revision.Aug 28 2019, 8:56 AM
Restricted Application added a project: KWin. · View Herald TranscriptAug 28 2019, 8:56 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Aug 28 2019, 8:56 AM
zzag planned changes to this revision.Aug 30 2019, 5:23 PM

Perhaps it's a good idea to add a test case.

zzag updated this revision to Diff 65014.Aug 30 2019, 8:24 PM
zzag edited the summary of this revision. (Show Details)
zzag edited the test plan for this revision. (Show Details)

Add tests.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 31 2019, 10:47 AM
This revision was automatically updated to reflect the committed changes.