Skip to content

OutputOrderWatcher: save disabled screens from xrandr

Fushan Wen requested to merge work/fuf/490746 into master

Reason for the change

QGuiApplication::screens() might still contain the disabled screens, which will cause the screen list in ScreenPool doesn't match QGuiApplication::screens(), as can be seen in the assert message from bug 490746.

$ journalctl -b --user /usr/bin/plasmashell 
lip 24 10:52:18 beton plasmashell[3503]: ASSERT failure in void ScreenPool::screenInvariants(): "ScreenPool ( 0x566d39462ff0 ) Internal state:
                                          Screen Order:         QList(QScreen(0x566d3914d400, name="DP-1")) 
                                          "Fake" screens:         QSet() 
                                          Redundant screens covered by other ones:         QHash() 
                                          All screens, ordered by size:         QList(QScreen(0x566d3914d400, name="DP-1")) 
                                          All screen that QGuiApplication knows:         QList(QScreen(0x566d3914d390, name="eDP-1"), QScreen(0x566d3914d400, name="DP-1")) 
                                          ", file ./shell/screenpool.cpp, line 375
lip 24 10:52:19 beton plasmashell[3504]: ASSERT failure in void ScreenPool::screenInvariants(): "ScreenPool ( 0x5c898601bb30 ) Internal state:
                                          Screen Order:         QList(QScreen(0x5c8985d23400, name="DP-1")) 
                                          "Fake" screens:         QSet() 
                                          Redundant screens covered by other ones:         QHash() 
                                          All screens, ordered by size:         QList(QScreen(0x5c8985d23400, name="DP-1")) 
                                          All screen that QGuiApplication knows:         QList(QScreen(0x5c8985d23390, name="eDP-1"), QScreen(0x5c8985d23400, name="DP-1")) 
                                          ", file ./shell/screenpool.cpp, line 375

Test plan

It seems to be very racey. I cannot reproduce it.

Screenshots or screen recordings

Bugs fixed

BUG: 490746 BUG: 464377 FIXED-IN: 6.1.4

Merge request reports

Loading