KMainWindow: fix autoSaveSettings to catch QDockWidgets being shown again
ClosedPublic

Authored by kossebau on Jan 7 2020, 4:49 PM.

Details

Summary

If QDockWidgets are "shown" in QWidget sense a second time, no resize or
move events might happen as the widget has already been layouted before
and might simply reappear at same position with same size.
The old logic did not catch this, so would keep an outdated state stored
in the auto-save settings of the window, which then would result in wrong
state being enforced on restoring.

Test Plan

Open KDevelop, open a toolview which was not open before (e.g. "Search in
all Files"), switch to another toolview not open before, then switch back
to the first toolview. Now either switch the currently viewed document
(e.g. open another file) or quit & reopen KDevelop.
Before the first toolview would hide itself despite officially being still
visible, with this patch the state is properly hold (when internally being
restored, like during finalizeGUI on KXmlGui client change).

Diff Detail

Repository
R263 KXmlGui
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Jan 7 2020, 4:49 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 7 2020, 4:49 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
kossebau requested review of this revision.Jan 7 2020, 4:49 PM

KMainWindowPrivate::CompressCalls being used here still exposes a small issue, as this opens a small time window where the state is not catched before a xmlgui client change happens, so some finalizeGUI might (in theory) still use old state data, as autoSaveSettings is not yet triggered on e.g. xmlgui client removal.
Something to look into next. But this here should improve things already a lot.

SGOrava added a subscriber: SGOrava.Jan 8 2020, 6:52 PM
dfaure accepted this revision.Jan 11 2020, 9:24 AM
This revision is now accepted and ready to land.Jan 11 2020, 9:24 AM
This revision was automatically updated to reflect the committed changes.