Skip to content

feat(splash): auto-disable prelaunch splash after consecutive mismatches - #1315

Draft
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/splash-auto-disable-wm309
Draft

feat(splash): auto-disable prelaunch splash after consecutive mismatches#1315
deepin-wm wants to merge 1 commit into
linuxdeepin:masterfrom
deepin-wm:feat/splash-auto-disable-wm309

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

概述

实现 splash 匹配失败自动禁用功能。当应用的预启动闪屏连续匹配失败达到阈值次数后,自动禁用该应用的 splash 功能,避免无效闪屏干扰。

关联 issue: WM-309

改动内容

  • misc/dconfig/org.deepin.dde.treeland.json:新增全局配置项 prelaunchSplashMaxMismatchCount(默认 4,0 表示永不自动禁用)
  • misc/dconfig/org.deepin.dde.treeland.app.json:新增 per-app 配置项 splashMismatchCount(默认 0)
  • src/core/windowconfigstore.h/.cpp:新增 recordSplashMismatch()(累计失败次数,达到阈值则置 enablePrelaunchSplash=false 并重置计数)和 resetSplashMismatchCount()(匹配成功时重置计数)
  • src/core/shellhandler.cpp:在 3 个失败路径(splashCloseRequested、超时、handlePrelaunchSplashClosed)调用 recordSplashMismatch;在 2 个成功路径(ensureXdgWrapper、ensureXwaylandWrapper)调用 resetSplashMismatchCount

审核状态

Code Review 审核已通过。

Summary by Sourcery

Automatically disable prelaunch splash screens after repeated mismatches while preserving configurable per-application recovery behavior.

New Features:

  • Add configurable automatic disabling of per-application prelaunch splash screens after consecutive matching failures.

Enhancements:

  • Track splash mismatches per application and reset the count when a prelaunch splash successfully matches its window.

Add global config `prelaunchSplashMaxMismatchCount` (default 4, 0=never)
and per-app `splashMismatchCount`. Record mismatches on splash close,
timeout, and client close_splash; reset on successful window match.
When count reaches threshold, disable splash for that app.

添加全局配置 `prelaunchSplashMaxMismatchCount`(默认4,0表示永不禁用)
和 per-app `splashMismatchCount`。在闪屏关闭、超时、客户端 close_splash
时记录不匹配次数;成功匹配窗口时重置。达到阈值后禁用该应用闪屏。

Log: 闪屏匹配失败自动禁用功能
Influence: 应用连续多次闪屏匹配失败后自动禁用闪屏,避免无效闪屏干扰。
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implements automatic disabling of prelaunch splash per app after a configurable number of consecutive splash mismatches, wiring new config fields through WindowConfigStore and ShellHandler to track failures and reset on successful matches.

Sequence diagram for auto-disabling prelaunch splash after consecutive mismatches

sequenceDiagram
    actor AppProcess
    participant ShellHandler
    participant GlobalConfig
    participant WindowConfigStore
    participant AppConfig

    AppProcess->>ShellHandler: createPrelaunchSplash(appId, timeoutMs)
    note over ShellHandler: Splash later times out / is closed
    ShellHandler->>GlobalConfig: prelaunchSplashMaxMismatchCount()
    GlobalConfig-->>ShellHandler: maxMismatchCount
    ShellHandler->>WindowConfigStore: recordSplashMismatch(appId, maxMismatchCount)
    WindowConfigStore->>WindowConfigStore: configForApp(appId)
    WindowConfigStore-->>AppConfig: obtain instance
    WindowConfigStore->>AppConfig: splashMismatchCount()
    WindowConfigStore->>AppConfig: setSplashMismatchCount(count+1)
    alt [count+1 >= maxMismatchCount]
        WindowConfigStore->>AppConfig: setEnablePrelaunchSplash(false)
        WindowConfigStore->>AppConfig: setSplashMismatchCount(0)
    end

    note over AppProcess,ShellHandler: On a later successful match
    AppProcess->>ShellHandler: ensureXdgWrapper/ensureXwaylandWrapper(targetAppId)
    ShellHandler->>WindowConfigStore: resetSplashMismatchCount(targetAppId)
    WindowConfigStore->>WindowConfigStore: configForApp(targetAppId)
    WindowConfigStore-->>AppConfig: obtain instance
    WindowConfigStore->>AppConfig: splashMismatchCount()
    alt [splashMismatchCount() != 0]
        WindowConfigStore->>AppConfig: setSplashMismatchCount(0)
    end
Loading

File-Level Changes

Change Details Files
Introduce global and per-app configuration for tracking splash mismatch counts and the auto-disable threshold.
  • Add global config key prelaunchSplashMaxMismatchCount with default 4 and 0 meaning never auto-disable.
  • Add per-app config key splashMismatchCount with default 0 to persist consecutive mismatch counts.
misc/dconfig/org.deepin.dde.treeland.json
misc/dconfig/org.deepin.dde.treeland.app.json
Extend WindowConfigStore with APIs to record splash mismatches and reset mismatch counters, auto-disabling prelaunch splash when the threshold is reached.
  • Add recordSplashMismatch(appId, maxMismatchCount) to increment splashMismatchCount, log, and disable enablePrelaunchSplash plus reset the counter when count >= threshold.
  • Add resetSplashMismatchCount(appId) to clear non-zero splashMismatchCount and log the reset.
  • Use configForApp(appId) defensively, early-returning when appId is empty or config is missing.
src/core/windowconfigstore.h
src/core/windowconfigstore.cpp
Hook ShellHandler splash lifecycle paths into WindowConfigStore to track mismatches on failures and reset counters on successful prelaunch-to-window matches.
  • On splashCloseRequested, timeout, and handlePrelaunchSplashClosed mismatch cases, fetch global prelaunchSplashMaxMismatchCount and call recordSplashMismatch(appId, maxMismatchCount) when m_windowConfigStore is available.
  • On successful ensureXdgWrapper and ensureXwaylandWrapper prelaunch matches, call resetSplashMismatchCount(targetAppId) when m_windowConfigStore is available.
  • Ensure mismatch recording uses the wrapper appId captured before destruction in the timeout path.
src/core/shellhandler.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-bot

deepin-bot Bot commented Aug 28, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.9.1
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #1348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants