[Dialog] Handle dialog being minimized gracefully
ClosedPublic

Authored by broulik on May 14 2018, 2:48 PM.

Details

Summary

Dialogs don't show up in task bar and also don't have window decoration so they're not meant to be minimized.
However, they might still be minimized by external means, such as "Minimize All" plasmoid.
In this case hide the dialog. Also, Qt restores a minimize state when showing again, rendering the dialog inaccessible. Before showing, always unset the minimized state using new Qt 5.10 API

BUG: 381242

Test Plan
  • Opened system tray, checked the pin, Minimized All → Tray "is expanded" line disappeared
  • Opened system tray again → Dialog showed up just fine

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.May 14 2018, 2:48 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 14 2018, 2:48 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.May 14 2018, 2:48 PM
broulik added inline comments.
src/plasmaquick/dialog.cpp
1371 ↗(On Diff #34147)

We don't know the previous state of the window with windowState (singular, pre-5.10 API) so we cannot restore a full screen or maximized state. Not sure if that is a usecase, though. Anyway, this new API lets us just unset a particular state.

mart added a subscriber: mart.May 16 2018, 11:51 AM
mart added inline comments.
src/plasmaquick/dialog.cpp
1371 ↗(On Diff #34147)

if the window was hidden anyways, aren't their states lost?

mart accepted this revision.May 16 2018, 11:55 AM
This revision is now accepted and ready to land.May 16 2018, 11:55 AM
This revision was automatically updated to reflect the committed changes.