Commit 22fa69d9 authored by Marco Martin's avatar Marco Martin Committed by Nate Graham
Browse files

Use relayout locking

This makes use of the layout locking freature introduced in
The resize of the layout area can happen either by screen resolution
change or available screen area change (a panel appears or is resized).

This is not an atomic operation, as width and height are usually set in
2 different operations, and even worse the layout area is resized to
match the available one with an animation, so many intermediate resizes
that should never cause a relayout happen.

A compression timer limits the actual relayouts to hopefully one,
 but if the system is really slowed down
(for instance, startup) the timer may expire and cause relayouts in
non useful sizes, losing the needed configuration.

The lock blocks all relayout and config writes when the size of the
layout area doesn't correspond to corona availablescreenrect, which are
the only "settled" cases.


(cherry picked from commit bd676333)
parent aa27d703
Pipeline #236130 passed with stage
in 4 minutes and 18 seconds
......@@ -262,6 +262,7 @@ FolderViewDropArea {
ContainmentLayoutManager.AppletsLayout {
id: appletsLayout
anchors.fill: parent
relayoutLock: width != plasmoid.availableScreenRect.width || height != plasmoid.availableScreenRect.height
// NOTE: use plasmoid.availableScreenRect and not own width and height as they are updated not atomically
configKey: "ItemGeometries-" + Math.round(plasmoid.screenGeometry.width) + "x" + Math.round(plasmoid.screenGeometry.height)
fallbackConfigKey: plasmoid.availableScreenRect.width > plasmoid.availableScreenRect.height ? "ItemGeometriesHorizontal" : "ItemGeometriesVertical"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment