WM-449: fix(surface): use dedicated field for fullscreen state snapshot - #1390
WM-449: fix(surface): use dedicated field for fullscreen state snapshot#1390deepin-wm wants to merge 2 commits into
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFix fullscreen state restoration by storing the pre-fullscreen state in a dedicated member, keeping it independent from minimize/restore bookkeeping and preserving the correct state across fullscreen, minimize, restore, and exit transitions. State diagram for fullscreen and minimized state restorationstateDiagram-v2
[*] --> Normal
Normal --> Fullscreen: enterFullscreen()
Fullscreen --> Minimized: minimize()
Minimized --> Fullscreen: restoreFromMinimized()
Fullscreen --> Normal: leaveFullscreen()
state Fullscreen {
[*] --> Active
Active: m_stateBeforeFullscreen = Normal
}
note right of Fullscreen
m_previousSurfaceState is used by minimize/restore.
m_stateBeforeFullscreen remains Normal.
end note
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
df160e0 to
1103357
Compare
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/surface/surfacewrapper.cpp" line_range="1994-1996" />
<code_context>
auto *xdgSurface = qobject_cast<WXdgToplevelSurface *>(m_shellSurface.data());
- if (xdgSurface->isInitialized())
+ if (xdgSurface->isInitialized()) {
+ if (m_surfaceState != State::Fullscreen && m_surfaceState != State::Minimized)
+ m_stateBeforeFullscreen = m_surfaceState;
setSurfaceStateDirectly(State::Fullscreen);
+ }
return;
</code_context>
<issue_to_address>
**issue (bug_risk):** An unmapped XdgToplevel that is currently `Minimized` bypasses the normal-path minimized guard and is changed to `Fullscreen`; the mapped path returns without changing state. This produces different fullscreen behavior solely based on whether the surface is mapped.
**Triggers:** When `enterFullscreen()` is called for an initialized, unmapped XdgToplevel whose state is `Minimized`.
**Suggested fix:** Return when `m_surfaceState == State::Minimized` before the unmapped-path transition, or apply the same minimized guard to both paths.
</issue_to_address>|
TAG Bot New tag: 0.10.0 |
1103357 to
27e22f6
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: deepin-wm, glyvut 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 |
9006fcf to
c3a0a64
Compare
| if (modal() && m_parentSurface && !m_parentSurface->isMinimized()) | ||
| m_parentSurface->minimize(false); | ||
|
|
||
| setVisibleDecoration(true); |
There was a problem hiding this comment.
最小化为什么会 调用 setVisibleDecoration(true) 和 updateTitleBar() ?
c3a0a64 to
6ba19c2
Compare
… state - Add independent `m_minimized` bitfield to SurfaceWrapper, decoupling minimized state from `m_surfaceState` so a window can be both minimized and fullscreen/maximized/tiling simultaneously. - `minimize()` / `restoreFromMinimized()` no longer go through `doSetSurfaceState()`; they only toggle `m_minimized` and call `shellSurface->setMinimize()` with focus/active-control updates. - `doSetSurfaceState()` removes the Minimized branch; `m_surfaceState` now only represents layout state (Normal/Maximized/Fullscreen/Tiling). - `enterFullscreen()` / `leaveFullscreen()` skip animation when the window is not visible (`!isVisible()`), using `setSurfaceStateDirectly()` instead. - QML: `WorkspaceProxy.qml` uses `!surface.minimized` instead of `surfaceState !== State.Minimized`; `MinimizeAnimation.qml` unifies `showShadow` on `surfaceState === State.Normal`. Log: 修复全屏→最小化→恢复→取消全屏后窗口卡在最小化状态 PMS: BUG-376727 Influence: SurfaceWrapper 全屏与最小化状态恢复逻辑,不影响其他模块 Signed-off-by: glyvut <guolin@uniontech.com>
- Add `bool minimized` field to `WindowInfo` POD in `treelandwindowtree.rep` and populate it in `treelandremotesource.cpp`. - `treeland-debug`: show minimized column in table/tree/top output, include it in JSON serialization, and report minimize/unminimize transitions in watch mode. Log: treeland-debug 补上 minimized 状态显示 PMS: BUG-376727 Influence: treeland-debug 调试工具及 WindowInfo 序列化,不影响窗口管理逻辑 Signed-off-by: glyvut <guolin@uniontech.com>
6ba19c2 to
d59d0d7
Compare
|
该 issue 已取消,关闭此 PR。 |
修复内容
m_previousSurfaceState同时被leaveFullscreen()与restoreFromMinimized()复用,在「全屏 → 最小化 → 恢复 → 取消全屏」序列中快照被污染为Minimized,导致窗口退出全屏后错误地恢复到最小化状态且此后无法回到 Normal。改动
src/surface/surfacewrapper.h:新增独立成员m_stateBeforeFullscreen,仅在进入全屏时一次性快照前置状态。src/surface/surfacewrapper.cpp:enterFullscreen()在两条路径(主路径 + XdgToplevel 未映射早返回路径)写入m_stateBeforeFullscreen,并加if (m_surfaceState != State::Fullscreen)重入守卫,避免已全屏再次进入全屏时快照被污染为Fullscreen。leaveFullscreen()改读m_stateBeforeFullscreen,不再依赖m_previousSurfaceState。m_previousSurfaceState继续服务于restoreFromMinimized()的原有职责,两者互不干扰。验证链路
enterFullscreen():m_stateBeforeFullscreen = Normal,状态 → Fullscreenminimize():状态 → Minimized(m_stateBeforeFullscreen不变)restoreFromMinimized():状态 → Fullscreen(m_stateBeforeFullscreen仍 Normal)leaveFullscreen():恢复到m_stateBeforeFullscreen = Normal✓Multica issue: WM-449
Summary by Sourcery
Decouple minimized state from surface state to preserve fullscreen restoration and accurately represent minimized windows throughout the compositor.
New Features:
Bug Fixes:
Enhancements: