Bug 414570

Summary: Items installed from KDE Store are not listed while "Installed" radio button is selected in "Get New Window Decorations..." window
Product: [Frameworks and Libraries] frameworks-knewstuff Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: Jeremy Whiting <jpwhiting>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.lohnau, arturllo, digitalethics, haim.lvov.10, kdelibs-bugs, nate, plasma-bugs, push.uni
Priority: NOR    
Version: 5.68.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.79
Attachments: screenshot

Description Patrick Silva 2019-11-27 12:33:44 UTC
Created attachment 124140 [details]
screenshot

STEPS TO REPRODUCE
1. open system settings > application style > window decorations
2. click on "Get New Window Decorations..." button
3. install some window decorations
4. reopen system settings > application style > window decorations
5. click on "Get New Window Decorations..." button
6. select "Installed" radio button

OBSERVED RESULT
as we can see in the attached screenshot, window decorations installed from kde store are not listed while "Installed" radio button is selected.

EXPECTED RESULT
all window decorations installed from kde store should be listed while "Installed" radio button is selected

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.17.3
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.2

ADDITIONAL INFORMATION
my screenshot shows breezemite, breezemite dark, ember, formaN and glowglass-cupertino
window decorations installed from kde store.
Comment 1 Nate Graham 2019-12-01 06:02:22 UTC
Also seems to affect SDDM themes: Bug 414569.
Comment 2 Nate Graham 2019-12-01 06:02:30 UTC
*** Bug 414569 has been marked as a duplicate of this bug. ***
Comment 3 Myriam Schweingruber 2020-05-09 14:55:56 UTC
Also affects Global Plasma Themes
Comment 4 Haim Lvov 2020-05-17 17:51:28 UTC
Appears in Kubuntu 20.04 too.
Comment 5 Artur Oliveira 2020-05-27 15:42:02 UTC
Same thing here! Using Kubuntu 20.04.
Comment 6 Martin 2020-06-30 17:26:22 UTC
Affects all widgets.
Comment 7 Alexander Lohnau 2020-07-21 19:28:39 UTC
Is this still reproducible on a newer frameworks version?
I tried this out on KDE Neon Unstable and it works for me.
Comment 8 Patrick Silva 2020-07-21 22:11:16 UTC
Currently I have 15 thrid-party window decorations installed on neon unstable.
Only 4 of them are listed in "Installed" section of "Get new window decorations" window.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.73.0
Qt Version: 5.14.2
Comment 9 Alexander Lohnau 2020-07-22 07:50:02 UTC
>Currently I have 15 thrid-party window decorations installed on neon unstable.
>Only 4 of them are listed in "Installed" section of "Get new window decorations" window.

But that says only that there were issues in the past. If they were not properly marked as installed in KNS, but they are installed on the system there is no way how they would get marked as installed now.

So maybe you could try to reinstall them and check if they are marked properly as installed :-)
Comment 10 Patrick Silva 2020-07-22 10:53:52 UTC
If the window decoration is not listed under "Installed", I can't uninstall it.
I tried with another user account and I can't reproduce with the steps provided.
But window decorations installed together global themes are still not marked as installed.
For example, install these global themes:
arc kde
sweet kde
mcmojave laf
aritim-light theme
chromeOS global theme

The window decorations of these global themes are installed but not listed in "Installed" section of "Get new window decorations" window. 

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.73.0
Qt Version: 5.14.2
Comment 11 Alexander Lohnau 2020-07-22 12:27:22 UTC
>The window decorations of these global themes are installed but not listed in "Installed" section of "Get new window decorations" window. 
Can confirm, this is a different, conceptual issue: To quote the docs:
>Global Themes in Plasma are Meta- or Super-Themes, capable of changing multiple aspects of the desktop environment at once, like Window Decoration, Plasma Theme...

So the global theme can provide window decorations, but these window decorations are not explicitly installed. Consequently they can't show up in the KNS dialog.

IMO it would not make sense to mark them as installed, because they are part of the global theme.
Comment 12 Patrick Silva 2020-07-22 14:19:42 UTC
So we have inconsistent behaviors. For example, when I install the light version of McMovaje global theme, Plasma also installs...
a plasma style
two window decorations
a color scheme
two icon themes
a cursor theme
a sddm theme
a splash screen 
a wallpaper
a task switcher

Almost all items above are marked as installed in their respective GHNS windows. The only exceptions are window decoration, task switcher and splash screen. All items marked as installed can be individually uninstalled via their respective GHNS windows. Another issue is that the window decorations installed together a global theme remain in the respective KCM after the global theme to be uninstalled.
Comment 13 Alexander Lohnau 2020-07-22 14:51:52 UTC
Thanks a lot for this detailed analysis!

And yes, this is horribly inconsistent. The global theme installer uses kpackage for the installation, so the problem seems related to that. I will see if I can find out more or find a solution :-).
Comment 14 Alexander Lohnau 2021-01-03 00:27:10 UTC
The issue is that in frameworkintegration/src/kpackage-install-handlers/kns/main.cpp the state of the entries does not get persistent. I will look into writing a fix.
Comment 15 Alexander Lohnau 2021-01-03 19:19:48 UTC
Well shit, it was not the issue I initially thought, but a completely different one: Using global themes the author can install dependencies. These installed dependencies consist of the knsrc file which tells the installer how it should be installed and an url to the KDE Store which tells the installer what entry should be installed.

Most of the global themes reference the old knsrc file, but the KCM uses the new one (aurorae.knsrc -> window-decorations.knsrc)

And because the new one is only used in the KNS dialog and most global themes use the old knsrc file they don't show up in the dialog. This is a regression from https://phabricator.kde.org/D18458#change-vWY7oE457t7I.

I am not sure if we really fix this, because KNS has the concept that there is only one knsrc file and one cache file that belongs to it. And we can not 'just' remove the old location, because that is already used in the KDE Store.

Could we maybe do some workarounds using a symlink to link the old location to the new location? Feels super hacks, but I don't see any other way to solve this :/
Comment 16 Bug Janitor Service 2021-01-04 16:27:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/frameworkintegration/-/merge_requests/3
Comment 17 Alexander Lohnau 2021-01-05 15:31:13 UTC
Git commit 9eed27b508a54ee4b8b4097f351dc9740114b236 by Alexander Lohnau.
Committed on 04/01/2021 at 16:23.
Pushed by alex into branch 'master'.

Fix window decorations not being uninstallable
FIXED-IN: 5.79

M  +31   -0    src/kpackage-install-handlers/kns/main.cpp

https://invent.kde.org/frameworks/frameworkintegration/commit/9eed27b508a54ee4b8b4097f351dc9740114b236