Bug 372099

Summary: Desktop widgets randomly not loaded
Product: [Plasma] plasmashell Reporter: Soukyuu <chrno-sphered>
Component: generic-multiscreenAssignee: Aleix Pol <aleixpol>
Status: RESOLVED DUPLICATE    
Severity: normal CC: notmart, plasma-bugs, tromzy
Priority: NOR    
Version: 5.8.3   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: plasmashellrc before breakage occurred
plasmashellrc after breakage occurred
plasmashellrc fixed version, currently used
plasma.desktop-appletsrc before the breakage occurred
plasma.desktop-appletsrc after the breakage occurred
plasma.desktop-appletsrc fixed version, currently used

Description Soukyuu 2016-11-05 11:48:42 UTC
This started with the update to 5.8.2, after I booted with only my second screen connected, once. Now, about half of the time the desktop widgets on my second screen are not loaded. Panel widgets are not affected. 

I cannot detect a pattern, maybe it's the detection order of the monitors on startup, but I think it might be loading the wrong config if the second screen is detected first.

I'm not using kscreen but an xorg.conf, so my screen setup is static. Journalctl doesn't seem to list any errors. Rolling back to an older plasma version did not help, so I am assuming some config file was written wrongly and screws things up now. Not sure if it's related, but it also gets stuck on the splash screen at ~80% for about 10 seconds, it did not do that before the widget issue appeared. 

Running up-to-date arch linux x64.
Comment 1 Soukyuu 2016-11-05 12:52:07 UTC
I don't know if it's the correct file, but I just compared three versions of the plasma-org.kde.plasma.desktop-appletsrc I have: 

- pre update and pre starting with only the second monitor connected are identical except for this part:

[Containments][45]
lastScreen=-1 vs 0 in the post update version

- the broken, current version of the file has added two new Containments sections, 46 and 61, with the same activityID as section 7, which is also still present in the file. This might be what is causing the issue. 46 contains most of the info 7 has, but 61 is almost empty, so I'm guessing 46 is a duplicate of 7 and 61 is the one with empty desktop widgets.

Tell me if you want me to post those, so you can take a look yourself, I'll have to redact a few things out of them for privacy reasons.

In any case, it seems the logic when one of the monitors is disconnected is flawed and results in faulty configuration files.
Comment 2 Marco Martin 2016-11-07 15:05:35 UTC
can you attach both plasmashellrc and plasma-org.kde.plasma.desktop-appletsrc ?
Comment 3 Soukyuu 2016-11-08 17:36:05 UTC
Created attachment 102127 [details]
plasmashellrc before breakage occurred

This is before updating/booting only with the second monitor connected
Comment 4 Soukyuu 2016-11-08 17:37:07 UTC
Created attachment 102128 [details]
plasmashellrc after breakage occurred

This is after updating/booting only with the second monitor connected
Comment 5 Soukyuu 2016-11-08 17:38:55 UTC
Created attachment 102129 [details]
plasmashellrc fixed version, currently used

This is after reverting and booting with both monitors connected
Comment 6 Soukyuu 2016-11-08 17:39:51 UTC
Created attachment 102130 [details]
plasma.desktop-appletsrc before the breakage occurred

This is before updating/booting only with the second monitor connected
Comment 7 Soukyuu 2016-11-08 17:40:24 UTC
Created attachment 102131 [details]
plasma.desktop-appletsrc after the breakage occurred

This is after updating/booting only with the second monitor connected
Comment 8 Soukyuu 2016-11-08 17:42:23 UTC
Created attachment 102132 [details]
plasma.desktop-appletsrc fixed version, currently used

This is after reverting and booting with both monitors connected
Comment 9 Marco Martin 2016-11-09 14:59:53 UTC
Git commit b8d3e09b3687082037a6d280d2032617121ae5e5 by Marco Martin.
Committed on 09/11/2016 at 14:54.
Pushed by mart into branch 'Plasma/5.8'.

make sure all outputs are known

at startup, if a screen id is missing from the screenpool mapping
containment::screen() will return -1 for a moment in the startup
phase even if it has a valid lastScreen

populate mappings of eventual missing stuff at screenpool ctor

make sure destroyed containments don't get assigned a view

reviewed-by: David Edmundson
Related: bug 371858, bug 371991, bug 371819, bug 371734

M  +11   -0    shell/screenpool.cpp
M  +7    -1    shell/shellcorona.cpp

http://commits.kde.org/plasma-workspace/b8d3e09b3687082037a6d280d2032617121ae5e5
Comment 10 David Edmundson 2016-11-10 10:28:49 UTC
Git commit 8a472f17ce11f3b79d740cdc21096d82b8683f3d by David Edmundson.
Committed on 10/11/2016 at 10:28.
Pushed by davidedmundson into branch 'Plasma/5.8'.

Avoid connecting to screen changed signals twice

Summary:
load() can be called multiple times; either from setShell or
loadLookAndFeelDefaultLayout. We still only want addOutput once when a
screen is added

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3320
Related: bug 371858, bug 371819, bug 371734
CBUG:371991

M  +3    -3    shell/shellcorona.cpp

http://commits.kde.org/plasma-workspace/8a472f17ce11f3b79d740cdc21096d82b8683f3d
Comment 11 David Edmundson 2016-11-10 12:03:45 UTC
Git commit 7154fb681adc73c482e862febc7ad008f77058dd by David Edmundson.
Committed on 10/11/2016 at 12:03.
Pushed by davidedmundson into branch 'Plasma/5.8'.

Load screenpool at the same time as we connect to screenchanged signals

Summary:
Otherwise we have a gap during load (waiting querying kactivities))
between screen pool being created and us connecting to the screen
changed signals, which in turn are used to update screen pool.

In particular the primary screen can get out of sync between the current
state and the screen pool.

Test Plan: Based on Christopher Feck's research and initial patch

Reviewers: #plasma

Subscribers: mart, rwooninck, fvogt, cfeck, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3319
Related: bug 371858, bug 371819, bug 371734
    CBUG:371991

M  +1    -0    shell/autotests/screenpooltest.cpp
M  +8    -0    shell/screenpool.cpp
M  +1    -0    shell/screenpool.h
M  +3    -1    shell/shellcorona.cpp

http://commits.kde.org/plasma-workspace/7154fb681adc73c482e862febc7ad008f77058dd
Comment 12 Marco Martin 2016-11-17 10:58:39 UTC
*** Bug 372509 has been marked as a duplicate of this bug. ***
Comment 13 Marco Martin 2016-11-17 10:59:50 UTC

*** This bug has been marked as a duplicate of bug 371858 ***
Comment 14 Marco Martin 2016-11-17 11:00:35 UTC
needs to be tried again on 5.8.4 or neon devel edition
http://files.kde.org/neon/images/neon-devedition-gitunstable/current/