Bug 407041 - Desktop Panel "Visibility" Settings Not Available Through Scripting
Summary: Desktop Panel "Visibility" Settings Not Available Through Scripting
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: 5.15.2
Platform: Other Linux
: NOR task
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-29 06:56 UTC by Chase
Modified: 2019-05-06 21:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chase 2019-04-29 06:56:55 UTC
There is no scripting interface to set a panels "Visibility" option. Additionally, if this option (for my test it was [PlasmaViews][Panel 173]panelVisibility in ~/plasmashellrc) is changed in a script or with kwriteconfig5, calling the panel's reloadConfig() method does not reload this option.

To me the issue appears to partially stem from this particular option not being saved in the same file and group as other panel options, so I think reloadConfig() does not catch the change. As far as visibility not being scriptable, I'm not surprised it hasn't been caught because it's probably not common, I came across this with a pretty obscure use-case. Anyway, it looks like this other bug is related: https://bugs.kde.org/show_bug.cgi?id=396796 , bug id #396796 

In my personal case, I want to toggle between panelVisibility 0 and 3 which are "Always Visible" and "Windows Can Cover." I can get the same functionality I need by going another route, but I think it would be better if I could do it with plasma scripting.


To be clear, I would expect that the Panel object in the scripting interface would have a method to change the visibility option. Additionally, if this option gets changed, the reloadConfig() method should reflect the changed option.
Comment 1 Kai Uwe Broulik 2019-04-29 07:08:21 UTC
panel.hiding = "windowscover"; should do the trick. Other values are "windowsbelow", "autohide", and "none".
Comment 2 Chase 2019-05-06 21:38:00 UTC
(In reply to Kai Uwe Broulik from comment #1)
> panel.hiding = "windowscover"; should do the trick. Other values are
> "windowsbelow", "autohide", and "none".

Strangely enough, when I do it this way, it stores that value, and I can recover it between plasma sessions, but the value has no effect, and it is not reflected in the relevant configuration key. I'll try this with a fresh user, and I'll also try it with only a single monitor, since I have seen some bugs be related to my multiple monitor configuration.
Comment 3 Chase 2019-05-06 21:46:38 UTC
(In reply to Kai Uwe Broulik from comment #1)
> panel.hiding = "windowscover"; should do the trick. Other values are
> "windowsbelow", "autohide", and "none".

It works on my laptop, so I'll try to narrow down what is different from my PC