fix(surface): set maximized on initial surface commit - #1281
Conversation
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:
|
[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 GuideMoves initial xdg-toplevel state handling (maximized/fullscreen) into SurfaceWrapper and ShellHandler so geometry and state are correctly set on the first commit, and generalizes prelaunch/maximize/fullscreen handling for both XWayland and XdgToplevel surfaces while avoiding double-configure on initial commit. Sequence diagram for initial xdg_toplevel commit state handlingsequenceDiagram
actor Client
participant WXdgToplevelSurface as WXdgToplevelSurface
participant ShellHandler as ShellHandler
participant SurfaceWrapper as SurfaceWrapper
participant WSurface as WSurface
Client->>WXdgToplevelSurface: set requested.maximized/fullscreen
WXdgToplevelSurface->>ShellHandler: ensureXdgWrapper(surface, title)
ShellHandler->>SurfaceWrapper: ensureXdgWrapper creates wrapper
SurfaceWrapper->>SurfaceWrapper: setup()
SurfaceWrapper->>WSurface: connect surface().commit
alt surface.isInitialized
ShellHandler->>SurfaceWrapper: setSurfaceStateDirectly(initialState)
end
Client->>WSurface: commit
WSurface-->>SurfaceWrapper: commit signal
alt requested.fullscreen
SurfaceWrapper->>SurfaceWrapper: setSurfaceStateDirectly(Fullscreen)
else requested.maximized and isMaximizable()
SurfaceWrapper->>SurfaceWrapper: setSurfaceStateDirectly(Maximized)
else existing state is Maximized/Fullscreen
SurfaceWrapper->>SurfaceWrapper: setSurfaceStateDirectly(Normal)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| QObject::connect(m_shellSurface->surface(), &WSurface::mappedChanged, | ||
| this, | ||
| &SurfaceWrapper::onMappedChanged); | ||
| if (m_type == Type::XdgToplevel) { |
There was a problem hiding this comment.
为什么这次你放 setup 里了, 之前 xwayland 没有?
| this, | ||
| &SurfaceWrapper::onMappedChanged); | ||
| if (m_type == Type::XdgToplevel) { | ||
| QObject::connect(m_shellSurface->surface(), &WSurface::commit, this, [this] { |
|
TAG Bot New tag: 0.8.18 |
|
TAG Bot New tag: 0.9.0 |
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
Handle initial requested fullscreen/maximized state for xdg-toplevel and XWayland surfaces directly in SurfaceWrapper so window geometry and state are correctly set on first commit.
Bug Fixes:
Enhancements: