Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-wm 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 |
Reviewer's GuideFixes the minimize/restore state bookkeeping so a window that was fullscreen when minimized can later exit fullscreen back to its original Normal state. The implementation snapshots and restores the pre-minimize state while retaining the true old state for cleanup, and also adjusts output selection and automatic surface-output ownership handling. Sequence diagram for restoring window state after minimize and fullscreen exitsequenceDiagram
participant User
participant SurfaceWrapper
User->>SurfaceWrapper: setSurfaceState(Fullscreen)
SurfaceWrapper->>SurfaceWrapper: doSetSurfaceState(Fullscreen)
User->>SurfaceWrapper: setSurfaceState(Minimized)
SurfaceWrapper->>SurfaceWrapper: doSetSurfaceState(Minimized)
SurfaceWrapper->>SurfaceWrapper: m_preMinimizePreviousState = Normal
User->>SurfaceWrapper: restoreFromMinimized()
SurfaceWrapper->>SurfaceWrapper: doSetSurfaceState(Fullscreen)
SurfaceWrapper->>SurfaceWrapper: m_previousSurfaceState = Normal
User->>SurfaceWrapper: leaveFullscreen()
SurfaceWrapper->>SurfaceWrapper: setSurfaceState(Normal)
SurfaceWrapper->>SurfaceWrapper: doSetSurfaceState(Normal)
Flow diagram for preserving the pre-minimize surface stateflowchart TD
A[Current state is not Minimized] --> B{Entering Minimized?}
B -->|Yes| C[Save m_previousSurfaceState in m_preMinimizePreviousState]
B -->|No| D[Continue state transition]
C --> E[Transition to Minimized]
E --> F{Leaving Minimized?}
F -->|Yes| G[Restore m_previousSurfaceState from m_preMinimizePreviousState]
F -->|No| H[Remain Minimized]
G --> I[Use oldState for prior-state cleanup]
D --> I
I --> J[Restore fullscreen to Normal]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
When a window is minimized while fullscreen and then restored, the m_previousSurfaceState was overwritten with Minimized, causing leaveFullscreen() to restore to Minimized instead of the original state (e.g. Normal). Add m_preMinimizePreviousState to snapshot m_previousSurfaceState when entering Minimized and restore it when leaving Minimized. Use a local oldState variable in the switch so the old-state cleanup (setMinimize(false) etc.) still runs correctly on the Minimized->restore transition. Fixes: WM-461 Link: https://pms.uniontech.com/bug-view-376727.html
deepin-wm
force-pushed
the
fix/wm-461-fullscreen-restore
branch
from
September 11, 2026 10:03
cf50d91 to
db70d26
Compare
Contributor
|
#1396 fixed it |
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.
Problem
F11 退出全屏后,窗口未还原到原始大小,而是变为最小化状态。
复现路径:
leaveFullscreen()调用setSurfaceState(m_previousSurfaceState)→ Minimized → 窗口最小化Root Cause
m_previousSurfaceState同时服务于restoreFromMinimized()和leaveFullscreen()。在步骤 4 中,restoreFromMinimized()调用doSetSurfaceState(Fullscreen),此时代码执行m_previousSurfaceState = m_surfaceState(即 Minimized),覆盖了步骤 2 保存的 Normal,导致步骤 5leaveFullscreen()恢复到 Minimized 而非 Normal。Fix
src/surface/surfacewrapper.h:新增成员变量m_preMinimizePreviousState,在进入 Minimized 时保存当前m_previousSurfaceState,在离开 Minimized 时恢复它。src/surface/surfacewrapper.cppdoSetSurfaceState():willBeMinimized && !wasMinimized):保存m_preMinimizePreviousState = m_previousSurfaceStatewasMinimized && !willBeMinimized):恢复m_previousSurfaceState = m_preMinimizePreviousStateoldState替代 switch 块中的m_previousSurfaceState.value(),确保离开 Minimized 时仍正确执行setMinimize(false)等旧状态清理逻辑修复后步骤 4 恢复
m_previousSurfaceState = Normal,步骤 5leaveFullscreen()正确还原到 Normal 状态。Issue
Summary by Sourcery
Restore the original window state when exiting fullscreen after minimizing and restoring the window.
Bug Fixes:
Enhancements: