From afdaf2a13656a4bbf68be3355905f4ff30fe2564 Mon Sep 17 00:00:00 2001 From: wjyrich Date: Tue, 17 Mar 2026 18:21:39 +0800 Subject: [PATCH] fix: stop submenu loader delay timer when menu becomes visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed an issue where the submenu loader delay timer was not properly stopped when the menu becomes visible. This could cause timing issues where the timer might interfere with submenu loading behavior. The fix ensures that when the menu becomes visible, the delay timer is immediately stopped before activating the submenu loader, preventing any potential race conditions or unexpected behavior. Influence: 1. Test opening and closing system tray menus to ensure smooth submenu transitions 2. Verify that submenus load correctly without delays when menu becomes visible 3. Check that timer functionality still works correctly when menu is hidden 4. Test with various system tray items that have submenus to ensure consistent behavior fix: 当菜单可见时停止子菜单加载器延迟计时器 修复了当菜单变为可见时子菜单加载器延迟计时器未正确停止的问题。这可能导致 计时问题,计时器可能干扰子菜单加载行为。此修复确保当菜单变为可见时,在激 活子菜单加载器之前立即停止延迟计时器,防止任何潜在的竞争条件或意外行为。 Influence: 1. 测试打开和关闭系统托盘菜单,确保子菜单转换流畅 2. 验证当菜单变为可见时,子菜单能正确加载且无延迟 3. 检查当菜单隐藏时,计时器功能仍能正常工作 4. 测试具有子菜单的各种系统托盘项,确保行为一致 PMS: BUG-290637 --- panels/dock/tray/SurfacePopup.qml | 1 + panels/dock/tray/TrayItemSurfacePopup.qml | 1 + 2 files changed, 2 insertions(+) diff --git a/panels/dock/tray/SurfacePopup.qml b/panels/dock/tray/SurfacePopup.qml index 7832eb8b1..122ae045e 100644 --- a/panels/dock/tray/SurfacePopup.qml +++ b/panels/dock/tray/SurfacePopup.qml @@ -75,6 +75,7 @@ Item { onMenuVisibleChanged: { if (menuVisible) { + subMenuLoaderDelayTimer.stop() subMenuLoader.active = true } else { subMenuLoaderDelayTimer.start() diff --git a/panels/dock/tray/TrayItemSurfacePopup.qml b/panels/dock/tray/TrayItemSurfacePopup.qml index 781b7b0a6..d2406a169 100644 --- a/panels/dock/tray/TrayItemSurfacePopup.qml +++ b/panels/dock/tray/TrayItemSurfacePopup.qml @@ -57,6 +57,7 @@ Item { onMenuVisibleChanged: { if (menuVisible) { + subMenuLoaderDelayTimer.stop() subMenuLoader.active = true } else { subMenuLoaderDelayTimer.start()