Correctly handle when a new primary screen displaces the old
ClosedPublic

Authored by mart on Apr 6 2017, 5:07 PM.

Details

Summary

this is for the following setup:
the primary screen is at position 0,0 and gets disconnected.
the other screen will be moved at 0,0 and becomes primary

the screen is reconnected, the events arrive in the followin order:

  1. a new screen gets added, at 0,0 position (not primary yet, it may be markedredundant)
  2. the screen becomes primary, both screens still at 0,0
  3. the old screen gets moved out of the way

in the end result none of the two need to be redundant.
adding the old one in the redundant list, will cause reconsideroutputs
to consider it and create a view for it.

BUG: 377808

Test Plan

added and removed sevaral times a primary screen at 0,0
also tried other positions of screens to check it doesn't make regressions

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Apr 6 2017, 5:07 PM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 6 2017, 5:07 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart edited the summary of this revision. (Show Details)Apr 6 2017, 5:11 PM
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: romangg.Apr 7 2017, 8:33 AM
broulik edited edge metadata.Apr 7 2017, 8:44 AM

I can confirm that here it fixes the crash and panels and desktop are properly setup.

However, I messed around with my screen cables, unplugged the secondary, plugged it back in but KScreen would not restore my config, then I manually did it from its KCM and could trigger another plasma crash.

kscreen.kcm: Activate output 85
kscreen.kcm: KScreen::Output(0x1273c40) "DVI-0" true
kscreen.kcm: Activate output 85
kscreen.kcm: Saving.
kscreen.kcm: "DisplayPort-0" 83 KScreen::Output(0x1195ba0) 
        Connected: true 
        Enabled: true 
        Primary: true 
        Rotation: 1 
        Mode: "" @ 59.9502 Hz 
     Position: 0 x 0
kscreen.kcm: "HDMI-0" 84 KScreen::Output(0x11a0470) 
        Connected: false 
        Enabled: false 
        Primary: false 
        Rotation: 1 
        Mode: "unknown" @ 0 Hz 
     Position: 0 x 0
kscreen.kcm: "DVI-0" 85 KScreen::Output(0x1273c40) 
        Connected: true 
        Enabled: true 
        Primary: false 
        Rotation: 1 
        Mode: "" @ 59.8833 Hz 
     Position: 1920 x 0
add output QScreen(0x5725e50, name="DVI-0")
is output redundant QScreen(0x5725e50, name="DVI-0") QRect(1920,0 1680x1050)
kscreen: Requesting missing EDID for outputs (83, 85)
QQuickItem: Cannot use same item on different windows at the same time.
QQuickItem: Cannot use same item on different windows at the same time.
QQuickItem: Cannot use same item on different windows at the same time.
QQuickItem: Cannot use same item on different windows at the same time.
kscreen: Requesting missing EDID for outputs (83, 85)
KCrash: Attempting to start /usr/bin/plasmashell from kdeinit
sock_file=/run/user/1000/kdeinit5__0
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = plasmashell path = /usr/bin pid = 29116
This revision was automatically updated to reflect the committed changes.