fix: defer splash toplevel registration until real surface - #1383
Merged
Conversation
Reviewer's GuideDelays splash foreign-toplevel exposure until the real surface takes over, preventing early rectangle requests from being lost and fixing minimize animations that fall back to (0,0). Pending splash teardown is handled safely, and rectangle-change logging now distinguishes expected debug activity from missing dock-wrapper warnings. Sequence diagram for deferred splash toplevel registrationsequenceDiagram
participant Splash as SplashSurfaceWrapper
participant Manager as ForeignToplevelManager
participant Client as ToplevelClient
participant Dock as DockSurface
Manager->>Splash: addSurface(wrapper)
Manager->>Manager: insert into m_pendingSplashSurfaces
Splash-->>Manager: surfaceItemCreated()
Manager->>Manager: onSplashSurfaceItemCreated()
Manager->>Manager: addSurface(wrapper)
Manager->>Client: expose initialized toplevel handle
Client->>Manager: set_rectangle(rect)
Manager->>Dock: getSurface(surface)
Dock-->>Manager: dockWrapper
Manager->>Splash: setIconGeometry(iconGeometry)
State diagram for splash surface registration lifecyclestateDiagram-v2
[*] --> PendingSplash: addSurface(splash)
PendingSplash --> RegisteredToplevel: surfaceItemCreated()
PendingSplash --> [*]: removeSurface(splash)
RegisteredToplevel --> [*]: removeSurface(wrapper)
RegisteredToplevel --> RegisteredToplevel: rectangleChanged -> setIconGeometry
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 found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/modules/foreign-toplevel/foreigntoplevelmanagerv1.cpp" line_range="333-334" />
<code_context>
{
auto it = d->m_surfaces.find(wrapper);
if (it == d->m_surfaces.end()) {
+ // A splash that was torn down before the real surface took over is a
+ // legitimate unregistered surface, not a caller bug.
+ if (d->m_pendingSplashSurfaces.remove(wrapper))
+ return;
qCCritical(lcTlProtocol) << wrapper << " is not registered in foreign toplevel";
return;
</code_context>
<issue_to_address>
**issue (bug_risk):** removeSurface removes a pending splash from m_pendingSplashSurfaces and returns without disconnecting the surfaceItemCreated connection. If that wrapper later emits surfaceItemCreated while still alive, onSplashSurfaceItemCreated calls addSurface and registers a surface that was already explicitly removed.
**Triggers:** When a pending splash is removed before conversion but its wrapper later completes conversion.
**Suggested fix:** Disconnect the pending signal when removing the splash, or have onSplashSurfaceItemCreated verify that the wrapper is still pending before registering it.
```suggestion
if (!d->m_pendingSplashSurfaces.remove(wrapper))
return;
addSurface(wrapper);
```
</issue_to_address>
wineee
reviewed
Sep 8, 2026
wineee
requested changes
Sep 8, 2026
Groveer
force-pushed
the
fix_dock_point
branch
from
September 9, 2026 02:01
a7f152a to
21a681b
Compare
wineee
requested changes
Sep 9, 2026
Groveer
force-pushed
the
fix_dock_point
branch
6 times, most recently
from
September 9, 2026 03:50
bedcc5b to
df8bc15
Compare
wineee
previously approved these changes
Sep 9, 2026
1. Connect the foreign-toplevel rectangleChanged handler in setupHandleForWrapper for both splash and normal handles, so a client's set_rectangle sent during the splash phase is not silently dropped. 2. Keep splash toplevels registered in the taskbar as designed; the lost signal connection is moved earlier instead of deferring registration. Log: Fix minimize animation flying to top-left (0,0) for slow-starting XWayland apps whose icon geometry request was dropped during the splash phase. Influence: 1. Launch browser and verify the minimize animation targets the dock icon. 2. Rapidly open/close apps with splash screens and check no crashes. 3. Verify splash icon still appears in the taskbar during launch. fix: 在 splash 交接前提前连接 dock rectangle 处理 1. 在 setupHandleForWrapper 中对 splash 与普通 handle 统一提前连接 foreign-toplevel 的 rectangleChanged,避免 splash 阶段客户端的 set_rectangle 被静默丢弃。 2. 保留 splash 顶层注册到任务栏的设计,将丢失的信号连接提前而非 延迟注册。 Log: 修复慢启动 XWayland 应用最小化动画飞到左上角 (0,0) 的问题—— 其 splash 阶段的图标几何请求被丢弃。 Influence: 1. 启动浏览器验证最小化动画指向 dock 图标。 2. 快速开关带 splash 的应用验证无崩溃。 3. 验证启动过程中 splash 图标仍出现在任务栏。 PMS: BUG-375731 Signed-off-by: groveer <guoyao@uniontech.com>
Groveer
force-pushed
the
fix_dock_point
branch
from
September 9, 2026 04:06
df8bc15 to
ee158e6
Compare
wineee
approved these changes
Sep 9, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Groveer, wineee 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 |
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.
Log: Fix minimize animation flying to top-left (0,0) for slow-starting XWayland apps whose icon geometry request was silently dropped during the splash phase.
Influence:
fix: 延迟 splash 顶层注册至真实窗口接管
Log: 修复慢启动 XWayland 应用最小化动画飞到左上角 (0,0) 的问题——其
splash 阶段的图标几何请求被静默丢弃。
Influence:
PMS: BUG-375731
Summary by Sourcery
Ensure splash toplevels handle geometry updates reliably before real windows take over.
Bug Fixes:
Enhancements: