From 7bcbe9d5ebfeb22787fce2bb0dcc473fb660c5d6 Mon Sep 17 00:00:00 2001 From: Fangxun Zhao Date: Tue, 24 Nov 2026 15:29:42 +0800 Subject: [PATCH] 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) }