fix(xdg-shell): handle unknown normal size when restoring - #1388
Conversation
Keep the normal geometry unknown when an XDG toplevel is initially maximized or fullscreen before a normal window size has been observed. Send a 0x0 configure when restoring such a window so the client can choose its normal size. Avoid recording maximized or fullscreen geometry as the normal geometry during state transitions, and only persist fallback geometry for windows that are actually in the normal state. Log: fix XDG toplevel restoration with unknown normal size PMS: BUG-364225、364203 Influence: XDG toplevel maximize and fullscreen restoration
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zzxyb 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 GuideThe PR keeps normal geometry unset for XDG toplevels initially entering maximized or fullscreen, filters geometry updates during state transitions, and restores such windows with a 0x0 configure so clients choose their normal size instead of reusing maximized/fullscreen geometry. Sequence diagram for restoring an XDG toplevel with unknown normal sizesequenceDiagram
participant Compositor
participant SurfaceWrapper
participant XdgToplevel
participant Client
Compositor->>SurfaceWrapper: setSurfaceStateDirectly(Maximized or Fullscreen)
SurfaceWrapper->>SurfaceWrapper: setNormalGeometry(QRectF())
SurfaceWrapper->>SurfaceWrapper: applySurfaceStateWithoutGeometry(state)
SurfaceWrapper->>XdgToplevel: resize(QSize(0, 0))
XdgToplevel-->>Client: configure(0, 0)
Client-->>XdgToplevel: choose normal size
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| if (!checkSetSurfaceState(newSurfaceState)) | ||
| return; | ||
|
|
||
| if (m_type == Type::XdgToplevel && surface() && !surface()->mapped() |
There was a problem hiding this comment.
没看出来这个做法有啥用,应该是多余的,对于初始化就是最大化状态的窗口,本身就不会有normal geometry
|
TAG Bot New tag: 0.10.0 |
Keep the normal geometry unknown when an XDG toplevel is initially maximized or fullscreen before a normal window size has been observed.
Send a 0x0 configure when restoring such a window so the client can choose its normal size. Avoid recording maximized or fullscreen geometry as the normal geometry during state transitions, and only persist fallback geometry for windows that are actually in the normal state.
Log: fix XDG toplevel restoration with unknown normal size
PMS: BUG-364225、364203
Influence: XDG toplevel maximize and fullscreen restoration
Summary by Sourcery
Fix XDG toplevel restoration so windows without a known normal size retain that state until a client-provided normal geometry is available.
Bug Fixes: