Bug 420993

Summary: Invisible Media Player icon in System Tray
Product: [Plasma] plasmashell Reporter: Konrad Materka <materka>
Component: System Tray widgetAssignee: Konrad Materka <materka>
Status: RESOLVED FIXED    
Severity: normal CC: materka, nate
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.19.0
Sentry Crash Report:
Attachments: Screenshot from Nate who is also affected

Description Konrad Materka 2020-05-04 10:36:01 UTC
Created attachment 128130 [details]
Screenshot from Nate who is also affected

SUMMARY
This is an random issue. Sometimes when Media Player start for the first time Media Player icon is not rendered. I tested with Gwenview - when it is started and not playing icon of Medial Player is sometimes not rendered.

This is related to Bug 418662, but not the same.

STEPS TO REPRODUCE
1. Do not play anything (no Medial Player icon at all)
2. Run Gwenview
3. Check if Medial Player icon in hidden view is rendered correct.

OBSERVED RESULT
Sometimes icon is not rendered, looks like invisible or fully transparent.

EXPECTED RESULT
Icon rendered correctly.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.18
KDE Plasma Version: 5.18.80
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2
Comment 1 Nate Graham 2020-05-04 13:41:38 UTC
Can reproduce.
Comment 2 Konrad Materka 2020-05-24 09:56:40 UTC
Fix in: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/14
Comment 3 Konrad Materka 2020-05-25 22:17:45 UTC
Git commit 2ce60f4e502a29e7ce468fc9796fa5088a3486f6 by Konrad Materka.
Committed on 25/05/2020 at 22:17.
Pushed by kmaterka into branch 'Plasma/5.19'.

[applets/systemtray] Lazy initialize SystemTray model

Summary:
SystemTray model was created in constructor, delay initialization and
create it lazily.
The `SystemTray::appletAdded` signal is connected to both SystemTray's
model and `Container`. `Container` must be connected first, because it sets
some properties of newly added applet: `visible` to false and `parent`
to the root item (container). If `Container` is connected second, then
newly created applet ios added to the model and rendered, but immediately
after that `Container` changes visibility to false.

Test Plan:
1. Do not play anything (no Medial Player icon at all)
2. Run Gwenview
3. Check if Medial Player icon in hidden view is rendered correct.
Before change:
Sometimes icon is not rendered, looks like invisible or fully transparent.
After change:
Icon rendered correctly.

M  +27   -15   applets/systemtray/systemtray.cpp
M  +4    -2    applets/systemtray/systemtray.h

https://invent.kde.org/plasma/plasma-workspace/commit/2ce60f4e502a29e7ce468fc9796fa5088a3486f6