From 8f144122bc3ae4be21a0d1801467647c96a0e5af Mon Sep 17 00:00:00 2001 From: zhangkun2 Date: Mon, 14 Sep 2026 19:05:50 +0800 Subject: [PATCH] fix: reduce fullscreen-windowed switch stutter on 4K MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: dual ApplicationWindow visible-toggle re-renders from scratch on 4K; 100ms artificial delay in setCurrentFrameToWindowedFrame plus EffectOut startup animation compound main-thread blocking ~2s 2. Fix: replace QTimer::singleShot(100,...) with singleShot(0,...) to queue on next event loop iteration without fixed delay; change windowStartUpEffect from EffectOut to EffectNone to skip 4K fullscreen startup animation rendering 3. Impact: fullscreen-windowed mode switch is faster; fullscreen window no longer plays startup animation; potential regression of BUG-323633 visual glitch needs runtime verification Log: Reduce launcher mode switch stutter on 4K screens Influence: 1. Test fullscreen-windowed switch on 4K for stutter improvement 2. Test fullscreen-windowed switch on 1080p for no regression 3. Verify no window flicker or focus loss on fullscreen-windowed switch 4. Verify fullscreen window shows/hides correctly without animation fix: 降低4K屏幕下全屏窗口模式切换卡顿 1. 根因:双 ApplicationWindow 通过 visible 互斥切换在 4K 下需从零渲染, 100ms 人工延迟叠加 EffectOut 启动特效渲染导致主线程阻塞约 2s 2. 方案:将 QTimer::singleShot(100,...) 改为 singleShot(0,...), 排队到下一事件循环执行无固定延迟;将 windowStartUpEffect 从 EffectOut 改为 EffectNone,跳过 4K 全屏启动特效渲染 3. 影响:全屏-窗口模式切换速度提升;全屏窗口不再播放启动动画; BUG-323633 视觉故障可能回归,需运行时验证 Log: 降低启动器在4K屏幕下模式切换的卡顿 Influence: 1. 在4K分辨率下测试全屏-窗口模式切换卡顿是否改善 2. 在1080p分辨率下测试全屏-窗口模式切换无回归 3. 验证全屏-窗口切换时无窗口闪烁或焦点丢失 4. 验证全屏窗口正常显示/隐藏(无动画过渡) PMS: BUG-354837 --- launchercontroller.cpp | 2 +- qml/Main.qml | 2 +- shell-launcher-applet/package/launcheritem.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/launchercontroller.cpp b/launchercontroller.cpp index 81fac513..4037cf34 100644 --- a/launchercontroller.cpp +++ b/launchercontroller.cpp @@ -271,7 +271,7 @@ void LauncherController::showHelp() void LauncherController::setCurrentFrameToWindowedFrame() { setVisible(false); - QTimer::singleShot(100, this, [this]() { + QTimer::singleShot(0, this, [this]() { setCurrentFrame("WindowedFrame"); setVisible(true); }); diff --git a/qml/Main.qml b/qml/Main.qml index 1276629e..f22af63b 100644 --- a/qml/Main.qml +++ b/qml/Main.qml @@ -316,7 +316,7 @@ QtObject { DWindow.enableSystemMove: false // Fullscreen mode: always assume dark theme DWindow.themeType: ApplicationHelper.DarkType - DWindow.windowStartUpEffect: PlatformHandle.EffectOut + DWindow.windowStartUpEffect: PlatformHandle.EffectNone onVisibleChanged: { if (visible) { diff --git a/shell-launcher-applet/package/launcheritem.qml b/shell-launcher-applet/package/launcheritem.qml index 042c5cc8..0e66f040 100644 --- a/shell-launcher-applet/package/launcheritem.qml +++ b/shell-launcher-applet/package/launcheritem.qml @@ -227,7 +227,7 @@ AppletItem { DWindow.enableSystemMove: false // Fullscreen mode: always assume dark theme DWindow.themeType: ApplicationHelper.DarkType - DWindow.windowStartUpEffect: PlatformHandle.EffectOut + DWindow.windowStartUpEffect: PlatformHandle.EffectNone onVisibleChanged: { if (visible) {