https://bugs.kde.org/show_bug.cgi?id=357317

David Edmundson <k...@davidedmundson.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
         Resolution|---                         |FIXED
      Latest Commit|                            |http://commits.kde.org/plas
                   |                            |ma-desktop/389aef07d6adce84
                   |                            |aaffedd065004a37b74f6aae

--- Comment #4 from David Edmundson <k...@davidedmundson.co.uk> ---
Git commit 389aef07d6adce84aaffedd065004a37b74f6aae by David Edmundson.
Committed on 13/09/2016 at 15:17.
Pushed by davidedmundson into branch 'master'.

Simplify Panel lastSpacer + fix crash

Summary:
The panel contains an invisible Item lastSpacer, who will fill the width
of the layout if no other applet has Layout.fillWidth/Height set,
keeping all applets left aligned.

Previous this worked by reparenting the invisible item in/out of the
layout to the root item. This seems overkill when we can just toggle
visibility. I think the code existed from before the panel was managed
by a Layout.

Worse, the current code leads to a potential crash on teardown.
The root gets deleted, starting a foreach(child, children)
{child->delete}
This kills the task bar, which means we reparent the spacer to the
layout. The layout then finishes killing the children and kills the
spacer. We then get back to the root objects dtor which is now deleting
a previously deleted object. See bug report.

This patch also fixes the fact that addApplet/removeApplet had a
slightly different check to see if the spacer is needed or not, fixing a
hypothetical bug if you had a Hidden applet with fillWidth: true.

Test Plan:
In both horizontal and vertical:
 - have a panel without a task manager
 - add a task manager
 - remove a task manager

Reviewers: #plasma, mart

Reviewed By: mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D2742

M  +1    -5    containments/panel/contents/code/LayoutManager.js
M  +19   -50   containments/panel/contents/ui/main.qml

http://commits.kde.org/plasma-desktop/389aef07d6adce84aaffedd065004a37b74f6aae

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to