Skip to content
Commit 90d8ee28 authored by Sebastian Kügler's avatar Sebastian Kügler
Browse files

normalize output positions in setoperation

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

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D2496
parent 11eb4ad8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment