Support dynamic output enabling/disabling from KScreen
ClosedPublic

Authored by davidedmundson on Nov 13 2017, 5:44 PM.

Details

Summary

We need to keep the DrmOutput object to still have the
WaylandOutputDevice.

Screens currently start off enabled as before.

In order to keep KWin to have a correct index based list of screens we
need to store a second vector of currently enabled outputs for the
screens interface.

Test Plan

Had dual screens.
Disabled/Enabled each one through the kscreen KCM

Diff Detail

Repository
R108 KWin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson created this revision.Nov 13 2017, 5:44 PM
Restricted Application added a project: KWin. · View Herald TranscriptNov 13 2017, 5:44 PM
Restricted Application added subscribers: KWin, kwin, plasma-devel. · View Herald Transcript

Does KScreen allow to disable all screens? And if yes: how does KWin behave in this case? I had been thinking about this for some time and are not sure how KWin should handle this situation. I can see reasons to say "user asked for it, so all screens should go off" and I can see reason to say "that's an invalid configuration request: ignore".

Given how well Qt handled the no screen case in the past I'd advise against being able to disable all of them.

Ignore the request as "probably temporary" and just freeze rendering?

Does KScreen allow to disable all screens?

The user gets a prompt "are you sure you want to disable all outputs?"
If they press the "I'm an idiot" button, then it will.

and if yes: how does KWin behave in this case?

Very badly.

How will the Qt QPA behave:

Very badly.

Ignore the request as "probably temporary"

In theory, we should get atomic batched the change requests from kscreen. There's no reason for it to do that.


I'll make it never remove the last screen.
If I make it process any changes for currently disabled screens first, that should handle atomicly switching monitors nicely.

Make sure we always enable monitors before disabling them
Never remove the final screen

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptNov 17 2017, 12:08 PM
graesslin added inline comments.Nov 17 2017, 2:52 PM
plugins/platforms/drm/drm_backend.cpp
561

why return? Shouldn't it be a continue?

davidedmundson added inline comments.Nov 17 2017, 2:58 PM
plugins/platforms/drm/drm_backend.cpp
561

Can do. Though I'd want to change the existing loop too to keep it consistent.

skip monitors in changeset that don't exist without aborting

Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptNov 20 2017, 10:05 AM
graesslin accepted this revision.Nov 20 2017, 4:34 PM
This revision is now accepted and ready to land.Nov 20 2017, 4:34 PM
This revision was automatically updated to reflect the committed changes.