From 7bcbe9d5ebfeb22787fce2bb0dcc473fb660c5d6 Mon Sep 17 00:00:00 2001 From: Fangxun Zhao Date: Tue, 24 Nov 2026 15:29:42 +0800 Subject: [PATCH 1/2] fix(menu): raise menu window above panel popup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Raise the shared menu window right after showing it on xcb, because the panel popup became override-redirect with X11BypassWindowManagerHint and the WM no longer orders the two windows. 2. Mapping a window does not restack it, so a menu opened after the tray popup could stay buried under it, which is reproducible on the first right-click after opening the tray. 3. Keep the explicit restack limited to the xcb branch so the Wayland path is unchanged. Log: Raise panel menus explicitly on X11 so they are never hidden behind the tray popup. Influence: Dock and tray context menus always show above the panel popup. fix(menu): 菜单窗口显示后显式置顶 1. 在 xcb 下显示共享菜单窗口后调用 raise():面板弹窗自加入 X11BypassWindowManagerHint 后同样是 override-redirect,窗口管理器不再对两者排序。 2. map 不会改变堆叠顺序,因此托盘弹窗之后打开的菜单会被压在下面,表现为展开托盘 后第一次右键必然层级错误。 3. 显式置顶仅在 xcb 分支执行,Wayland 行为保持不变。 Log: X11 下菜单显示后显式置顶,避免被托盘弹窗遮挡。 PMS: BUG-384041 Influence: 托盘与任务栏右键菜单始终显示在面板弹窗之上。 --- frame/qml/PanelMenu.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frame/qml/PanelMenu.qml b/frame/qml/PanelMenu.qml index c6a06efaa..b3982905d 100644 --- a/frame/qml/PanelMenu.qml +++ b/frame/qml/PanelMenu.qml @@ -98,6 +98,11 @@ Item { openPending = false menuWindow.title = windowTitle menuWindow.show() + // The panel popup window is override-redirect on xcb since + // X11BypassWindowManagerHint was added, so the WM no longer orders it + // against this window: map() does not raise, do it explicitly. + if (Qt.platform.pluginName === "xcb") + menuWindow.raise() DS.grabMouse(menuWindow) DS.grabKeyboard(menuWindow) } From 6e401008854a86385f96f15e7e590c2e509ac627 Mon Sep 17 00:00:00 2001 From: Fangxun Zhao Date: Thu, 3 Dec 2026 14:28:53 +0800 Subject: [PATCH 2/2] fix(dock): keep dock up while preview is shown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Track whether the compositor-drawn dock preview is currently displayed. 2. Stop the hide timer and force the dock to Show when a preview appears. 3. Restart the hide timer once the preview context closes or a tooltip replaces it. 4. Exclude a shown preview from the hide decision alongside transient children. Log: Prevent the dock from hiding while a window preview is open. Influence: Dock previews no longer disappear before the pointer moves away. fix(dock): 预览显示时保持任务栏显示 1. 记录当前是否有合成器绘制的任务栏预览处于显示状态。 2. 预览出现时停止隐藏定时器并强制任务栏显示。 3. 预览上下文关闭或被提示替换后重新启动隐藏定时器。 4. 隐藏判定中将已显示的预览视作与临时子窗口同等条件。 Log: 修复窗口预览打开时任务栏被隐藏的问题。 PMS: TASK-399551 Influence: 任务栏预览不再在鼠标移开前提前消失。 --- panels/dock/dockhelper.cpp | 15 +++++++++++++++ panels/dock/dockhelper.h | 2 ++ panels/dock/waylanddockhelper.cpp | 4 ++++ 3 files changed, 21 insertions(+) diff --git a/panels/dock/dockhelper.cpp b/panels/dock/dockhelper.cpp index e3767bcb1..dd269a52a 100644 --- a/panels/dock/dockhelper.cpp +++ b/panels/dock/dockhelper.cpp @@ -218,6 +218,7 @@ void DockHelper::checkNeedHideOrNot() } needHide &= !parent()->contextDragging(); + needHide &= !m_previewShown; // any enter will not make hide for (auto enter : m_enters) { @@ -269,6 +270,20 @@ void DockHelper::checkNeedShowOrNot() parent()->setHideState(Show); } +void DockHelper::setPreviewShown(bool shown) +{ + if (m_previewShown == shown) + return; + + m_previewShown = shown; + if (shown) { + m_hideTimer->stop(); + parent()->setHideState(Show); + } else { + m_hideTimer->start(); + } +} + void DockHelper::onMultitaskStateChanged(bool inMultitask) { if (m_inMultitaskView != inMultitask) { diff --git a/panels/dock/dockhelper.h b/panels/dock/dockhelper.h index aa2ac53ec..65d85544b 100644 --- a/panels/dock/dockhelper.h +++ b/panels/dock/dockhelper.h @@ -22,6 +22,7 @@ class DockHelper : public QObject void enterScreen(QScreen *screen); void leaveScreen(); + void setPreviewShown(bool shown); virtual QObject *dockPreviewContext(QWindow *anchor) { return nullptr; } @@ -55,6 +56,7 @@ public Q_SLOTS: private: bool m_inMultitaskView = false; + bool m_previewShown = false; QHash m_areas; QHash m_enters; QHash m_transientChildShows; diff --git a/panels/dock/waylanddockhelper.cpp b/panels/dock/waylanddockhelper.cpp index 3bf111425..2baf1d599 100644 --- a/panels/dock/waylanddockhelper.cpp +++ b/panels/dock/waylanddockhelper.cpp @@ -251,12 +251,15 @@ QObject *WaylandDockHelper::dockPreviewContext(QWindow *anchor) m_dockPreview.get(), [this]() { resetDockPreview(); }); // Late tooltip closes and frames must not replace a new preview. connect(m_dockPreview.get(), &TreeLandDockPreviewContext::windowPreviewShown, this, &WaylandDockHelper::closeTooltip); + connect(m_dockPreview.get(), &TreeLandDockPreviewContext::windowPreviewShown, this, [this]() { setPreviewShown(true); }); + connect(m_dockPreview.get(), &TreeLandDockPreviewContext::closed, this, [this]() { setPreviewShown(false); }); return m_dockPreview.get(); } void WaylandDockHelper::resetDockPreview() { closeTooltip(); + setPreviewShown(false); m_dockPreview.reset(); m_previewAnchor.clear(); } @@ -283,6 +286,7 @@ void WaylandDockHelper::showTooltip() default: return; } m_dockPreview->showTooltip(native->wlSurface(), qRound(anchor.x()), qRound(anchor.y()), direction); + setPreviewShown(false); wl_display_flush(native->display()->wl_display()); }