normalize output positions in setoperation
ClosedPublic

Authored by sebas on Aug 19 2016, 3:45 AM.

Details

Summary

When setting a config, outputs may fall outside of the virtual screen
layout. This can happen when, for example, a single screen is enabled
and its position is not zero. The screen size is a unified rect of the
enabled and connected outputs, which doesn't necessarily sit at 0,0
initially. By normalizing the output position, we avoid this pitfall.

Especially the xrandr backend struggles with this, since it will disable
outputs falling outside of the virtual screen, and it does so after
policy checks have happened, so in the worst (and actually fairly
common) case, it will disable the only remaining output, leading to ...

BUG:367490

The reason to do the normalization in SetConfigOperation right before
the config is passed to the backends to apply is to catch this
inconsistency problem with configs at a common entry-point. Doing it in
the library, rather than in the xrandr backend also means that we can
autotest it -- we can't sensible do that with the xrandr backend.

Test Plan
  • manually tested by enabling the left / top most output of two actual outputs, this failed before and left all outputs disabled, with this patch, it works as expected
  • added autotest to make sure the normalization works

Diff Detail

Repository
R110 KScreen Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sebas updated this revision to Diff 6054.Aug 19 2016, 3:45 AM
sebas retitled this revision from to normalize output positions in setoperation.
sebas updated this object.
sebas edited the test plan for this revision. (Show Details)
sebas added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptAug 19 2016, 3:45 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin accepted this revision.Aug 19 2016, 7:39 AM
graesslin added a reviewer: graesslin.
graesslin added a subscriber: graesslin.

The logic seems correct to me.

This revision is now accepted and ready to land.Aug 19 2016, 7:39 AM
This revision was automatically updated to reflect the committed changes.