fix(surface): set maximized/fullscreen geometry on initial surface co…#984
fix(surface): set maximized/fullscreen geometry on initial surface co…#984zzxyb wants to merge 1 commit into
Conversation
Reviewer's GuideMove initial xdg_toplevel commit handling from WXdgToplevelSurfaceItem into SurfaceWrapper so that maximized/fullscreen geometry is correctly applied on the first commit, wiring a one-shot surface commit handler and configuring size/state based on requested maximized/fullscreen flags. Sequence diagram for initial xdg_toplevel surface commit handlingsequenceDiagram
actor Client
participant WSurface
participant SurfaceWrapper
participant WXdgToplevelSurface
participant WXdgToplevelHandle
participant Output
Client->>WSurface: commit
WSurface-->>SurfaceWrapper: commit(quint32) (Qt::SingleShotConnection)
SurfaceWrapper->>SurfaceWrapper: onInitialSurfaceCommit(serial)
alt m_type == Type::XdgToplevel
SurfaceWrapper->>WXdgToplevelSurface: handle()
WXdgToplevelSurface-->>WXdgToplevelHandle: handle()
WXdgToplevelHandle-->>WXdgToplevelHandle: base->initial_commit
alt base->initial_commit
WXdgToplevelHandle-->>WXdgToplevelHandle: requested.maximized
alt requested.maximized
SurfaceWrapper->>Output: validRect()
Output-->>SurfaceWrapper: size
SurfaceWrapper->>WXdgToplevelHandle: set_maximized(true)
end
WXdgToplevelHandle-->>WXdgToplevelHandle: requested.fullscreen
alt requested.fullscreen
SurfaceWrapper->>Output: rect()
Output-->>SurfaceWrapper: size
SurfaceWrapper->>WXdgToplevelHandle: set_fullscreen(true)
end
SurfaceWrapper->>WXdgToplevelSurface: resize(QSize)
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
onInitialSurfaceCommit, consider adding defensive checks (e.g., for a nulltoplevelfromqobject_castand fortoplevel->handle()/handle->base) before dereferencing to avoid hard-to-trace crashes if assumptions aboutm_shellSurfaceever change. - When neither
requested.maximizednorrequested.fullscreenis set,toplevel->resize(size)is still called with a default-constructedQSize; if that’s not intentional, you may want to guard the resize withif (size.isValid()). - If both
requested.maximizedandrequested.fullscreenare true, the second branch will overwrite thesizefrom the first; it might be clearer to explicitly choose one state (or assert they are mutually exclusive) so the behavior is well-defined.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `onInitialSurfaceCommit`, consider adding defensive checks (e.g., for a null `toplevel` from `qobject_cast` and for `toplevel->handle()` / `handle->base`) before dereferencing to avoid hard-to-trace crashes if assumptions about `m_shellSurface` ever change.
- When neither `requested.maximized` nor `requested.fullscreen` is set, `toplevel->resize(size)` is still called with a default-constructed `QSize`; if that’s not intentional, you may want to guard the resize with `if (size.isValid())`.
- If both `requested.maximized` and `requested.fullscreen` are true, the second branch will overwrite the `size` from the first; it might be clearer to explicitly choose one state (or assert they are mutually exclusive) so the behavior is well-defined.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
TAG Bot New tag: 0.8.10 |
b53dfe6 to
2e6572e
Compare
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
[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 |
c9e59d1 to
11e5c14
Compare
…mmit Move initial commit handling from WXdgToplevelSurfaceItem to SurfaceWrapper to properly configure window geometry when the client requests maximized or fullscreen state at first commit. Log: set maximized/fullscreen geometry on initial surface commit PMS: BUG-366199 Influence:
|
TAG Bot New tag: 0.8.11 |
…mmit
Move initial commit handling from WXdgToplevelSurfaceItem to SurfaceWrapper to properly configure window geometry when the client requests maximized or fullscreen state at first commit.
Log: set maximized/fullscreen geometry on initial surface commit PMS: BUG-366199
Influence:
Summary by Sourcery
Bug Fixes: