Skip to content
  • Robert Hoffmann's avatar
    Fix setting primary connector if primary output changed · ea19f9b6
    Robert Hoffmann authored and Nate Graham's avatar Nate Graham committed
    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.
    
    1. Boot machine with one screen connected to HDMI-3 (primary output).
    2. Log in
    3. Plug in second screen to HDMI-2:
    --> primary output changes from HDMI-3 to HDMI-2
    4. 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.
    
    5. 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
    ea19f9b6