fix: Window size not correctly restored after maximisation#3169
Merged
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom Apr 16, 2026
Merged
fix: Window size not correctly restored after maximisation#3169deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
Conversation
Log: During window maximisation, when `saveSize()` is triggered by the `widthChanged`/`heightChanged` signals, the screen dimensions override the previously saved normal window dimensions; furthermore, `width()`/`height()` use a ‘strictly greater than’ condition, causing the minimum boundary values to be incorrectly judged as invalid. pms: bug-353601
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnsures the control center window only persists its normal, visible size (not maximized/fullscreen or hidden states) and correctly treats configured minimum width/height as valid values, improving restoration of window size after maximization. Sequence diagram for saving window size during maximize and restoresequenceDiagram
actor User
participant QWindow
participant DccManager
participant DConfig
User->>QWindow: maximize()
QWindow-->>DccManager: widthChanged
QWindow-->>DccManager: heightChanged
DccManager->>DccManager: saveSize()
DccManager->>QWindow: windowStates()
DccManager->>QWindow: isVisible()
DccManager-->>DConfig: return (do not save) when maximized or hidden
QWindow-->>DccManager: windowStateChanged
DccManager->>DccManager: saveSize()
DccManager->>QWindow: windowStates()
DccManager->>QWindow: isVisible()
DccManager-->>DConfig: return (still maximized)
User->>QWindow: showNormal()
QWindow-->>DccManager: windowStateChanged
DccManager->>DccManager: saveSize()
DccManager->>QWindow: windowStates()
DccManager->>QWindow: isVisible()
DccManager->>QWindow: width()
DccManager->>QWindow: height()
DccManager->>DConfig: setValue(WidthConfig, width)
DccManager->>DConfig: setValue(HeightConfig, height)
User->>DccManager: show()
DccManager->>DConfig: value(WidthConfig), value(HeightConfig)
DccManager-->>QWindow: apply restored normal size
Updated class diagram for DccManager window sizing logicclassDiagram
class DConfig {
+ bool isValid() const
+ QVariant value(QString key) const
+ void setValue(QString key, QVariant value)
}
class QWindow {
+ void show()
+ void showNormal()
+ bool isVisible() const
+ Qt_WindowStates windowStates() const
+ int width() const
+ int height() const
+ void installEventFilter(QObject* filter)
}
class DccManager {
- QWindow* m_window
- DConfig* m_dconfig
+ void setMainWindow(QWindow* window)
+ void loadModules(bool async, QStringList dirs)
+ int width() const
+ int height() const
+ int sidebarWidth() const
+ void show()
+ bool isIndicatorShown(QString cmd) const
+ void saveSize()
+ void handleScreenAdded(QScreen* screen)
}
DccManager --> QWindow : manages
DccManager --> DConfig : persists_size_and_state
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
mhduiy
approved these changes
Apr 16, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: blocked) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: During window maximisation, when
saveSize()is triggered by thewidthChanged/heightChangedsignals, the screen dimensions override the previously saved normal window dimensions; furthermore,width()/height()use a ‘strictly greater than’ condition, causing the minimum boundary values to be incorrectly judged as invalid.pms: bug-353601
Summary by Sourcery
Ensure the control center window restores to its correct normal size instead of screen size after maximisation and hiding, and accept minimum configured sizes as valid.
Bug Fixes: