introduce the Defaults group for panel values
ClosedPublic

Authored by mart on Aug 2 2019, 2:10 PM.

Details

Summary

when plasma is starting up, there are no panel views yet
this means that if a thickness (or other values)
are written to the config file and then the resolution changes before
the panel view gets created, we'll have a view that will default
to 30 pixels regardless what the layout js file specified.

This makes the scripting only write to a [Default] group for resolution
dependent properties when panels are not actually present
when they are already there, interact directly with the view which is
the safest option.

the view will use whatever is in the defaults group as default if the
resolution dependent is there, and when a new value is set for a
resolution dependent one, also update the default, which will
be used when screen resolution changes, as new default value

Test Plan
  • With virtualbox, change resolution continuously when plasma is starting up

with an empty setup, panel is the expected size now, as opposed to 30

  • Stop Plasma. Change Screen resoluton with plasma *not* running, to a resoluton

still "unknown" to plasmashellrc, then start plasma again. Now the thickness saved
in [Default] is picked, instead of the arbitrary 30

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Aug 2 2019, 2:10 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 2 2019, 2:10 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart requested review of this revision.Aug 2 2019, 2:10 PM
apol added a subscriber: apol.Aug 5 2019, 4:55 PM

looks good to me overall.

shell/scripting/panel.cpp
249

Doesn't restore need calling now?

mart added inline comments.Aug 6 2019, 7:41 AM
shell/scripting/panel.cpp
249

No.
Before was setting the config key, and then called restore to actually sync the internal panel status with the new config.
Now is setting directly the panel status, so restore doesn't need to be called anymore

broulik accepted this revision.Aug 6 2019, 8:45 AM
This revision is now accepted and ready to land.Aug 6 2019, 8:45 AM
This revision was automatically updated to reflect the committed changes.