Fix setting primary connector if primary output changed
Summary:
If a user logged in with one screen connected plugs in
a second screen, which becomes the new primary screen,
this screen would stay black or behave weird.
Unplugging the screen again would mess up plasmashell.
Added to ScreenPool::setPrimaryConnector():
In the case primary output changed m_idForConnector
doesn't contain the new primary, so a screen mapping
is created for it.
Test Plan:
Testing on virtualbox or vmware player seems impossible, because
these don't allow disabling the first display (VGA-1) and booting
with the second (VGA-2) only.
- Boot machine with one screen connected to HDMI-3 (primary output).
- Log in
- Plug in second screen to HDMI-2:
--> primary output changes from HDMI-3 to HDMI-2
- OSD appears: extend to right
--> Without this patch, the new screen (HDMI-2) would stay blank.
--> With this patch applied, the screen content moves to the new
second screen.
- Unplug second screen (HDMI-2)
--> Without this patch, the background would get black, control panel
would disappear, could only be restored by restart of plasmashell
--> With this patch applied, screen content moves to the right and
works
Reviewers: Plasma, mart, davidedmundson
Reviewed By: Plasma, davidedmundson
Subscribers: davidedmundson, ngraham, plasma-devel
Tags: Plasma
Differential Revision: https://phabricator.kde.org/D13853