sebas created this revision. sebas added a reviewer: Plasma. Restricted Application added a project: Plasma. Restricted Application added a subscriber: plasma-devel.
REVISION 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 REPOSITORY rLIBKSCREEN KScreen Library BRANCH sebas/positionnormalization REVISION DETAIL https://phabricator.kde.org/D2496 AFFECTED FILES autotests/testscreenconfig.cpp src/setconfigoperation.cpp EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: sebas, #plasma Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas