Bug 419866

Summary: Desktop configure dialog does not close after clicking "OK" when changing containment plugin type.
Product: [Plasma] plasmashell Reporter: Yichao Yu <yyc1992>
Component: Desktop ContainmentAssignee: Marco Martin <notmart>
Status: RESOLVED DUPLICATE    
Severity: normal CC: bugseforuns, plasma-bugs
Priority: NOR    
Version: 5.18.4   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Yichao Yu 2020-04-09 03:33:00 UTC
SUMMARY
It's unclear if this is a plasma-desktop bug, or a plasma-workspace bug, or a Qt bug... See the debug note below.

STEPS TO REPRODUCE
1. Right click on desktop and bring up the desktop configure dialog from the right click menu.
2. Change the desktop type. The warning for applying immediately should appear.
3. Click "OK".

OBSERVED RESULT
The configure should apply and the dialog is opened again.

EXPECTED RESULT
The configure should apply and the dialog should close.

DEBUGGING
As far as I can tell, the sequence of event when clocking on the OK button is that.

[`accptAction.trigger()`](https://github.com/KDE/plasma-desktop/blob/3e8c7dada73ed838a93b0b0ffcd5c679627ffa54/desktoppackage/contents/configuration/AppletConfiguration.qml#L396)
calls a chain of functions which calls
[`root.saveConfig()`](https://github.com/KDE/plasma-desktop/blob/3e8c7dada73ed838a93b0b0ffcd5c679627ffa54/desktoppackage/contents/configuration/ConfigurationContainmentAppearance.qml#L38)
When [changing the containment type](https://github.com/KDE/plasma-desktop/blob/3e8c7dada73ed838a93b0b0ffcd5c679627ffa54/desktoppackage/contents/configuration/ConfigurationContainmentAppearance.qml#L49) which through a chain of events recreated a new `ContainmentConfigView` (didn't save backtrace, sorry) and then closed the old one.
After `root.saveConfig()` returns, the call to [`configDialog.close()`](https://github.com/KDE/plasma-desktop/blob/3e8c7dada73ed838a93b0b0ffcd5c679627ffa54/desktoppackage/contents/configuration/AppletConfiguration.qml#L397) appears to be calling the destroyed `ContainmentConfigView` and the new one is left open.

However, since the `ContainmentConfigView` constructor appears to be [setting the `configDialog`](https://github.com/KDE/plasma-workspace/blob/5545214d4420eccc8013331697259974affc7283/shell/containmentconfigview.cpp#L64) I'm not sure why it doesn't get picked up by the `configDialog.close()`. Is that supposed to be asynchronous or not show up until the next call for some reason? Or is it a qml compiler bug?

P.S. somehow I never got a breakpoint firing on the destructor of `ContainmentConfigView` so they apears to be leaked?

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:
(available in About System)
KDE Plasma Version:  5.18.4
KDE Frameworks Version: 5.68.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION
Comment 1 Patrick Silva 2020-04-09 23:08:46 UTC

*** This bug has been marked as a duplicate of bug 389109 ***