[Feedback on issues] BUG,dde-shell的bug造成我们开发的输入法与应用托盘冲突
Tofloor
poster avatar
chana4afk
deepin
2026-11-24 22:38
Author

BUG,dde-shell的bug造成我们开发的输入法与应用托盘冲突,经多轮挖掘最终确定是ddee-shell的问题

已同步github提交,建议在gitcode建仓

Description

On deepin/UOS (dde-shell + kwin on X11), the dock's application-tray popup (the panel opened by the ^ button at the bottom-right, dde-shell/panelpopup) fails to open whenever a third-party input method keeps a non-focusable UTILITY overlay window mapped (a candidate/toolbar window). When that overlay window is hidden, the tray popup opens normally.

The failure is independent of the overlay's screen position — moving the overlay to any location (including off-screen) does not restore the tray. It is also independent of the input method process itself: killing only the overlay window (while keeping the rest of the input method alive) immediately restores the tray; re-mapping that window breaks it again.

X11-level event routing is verified normal: the ButtonPress on the ^ arrow reaches the dock window correctly (confirmed via XRecord delivered_events with pure XTest injection), there is no active pointer grab, and DBus XEventMonitor also sees the click. The click is delivered but dde-shell does not open the popup.

Environment

  • OS: deepin/UOS (dde-shell panel/dock, kwin_x11, X11 session)
  • dde-shell dock at bottom of screen (48–56 px); _NET_WORKAREA reports the reserved bottom strip
  • Reproduced on 1920x1080, scale 1.0
  • Third-party IME with an SDL-based overlay window (see minimal reproducer below — no IME required)

Steps to reproduce

  1. Create a simple X11 window with these attributes (no IME needed):

    • _NET_WM_WINDOW_TYPE = _NET_WM_WINDOW_TYPE_UTILITY
    • WM_HINTS input = False (not focusable)
    • _NET_WM_STATE empty
    • mapped, kept on screen (position irrelevant)
    • override-redirect = False (managed by WM)
  2. Click the dock's bottom-right ^ tray button.

  3. Observe whether dde-shell/panelpopup opens.

Observed: popup does not open (stays at its closed 10x10 geo metry) while such a window is mapped. Unmap that window (or close it) → the popup opens immediately with normal size and icons. Map it again → failure returns.

Note on self-lock: in the real IME scenario the "click the tray" action itself focuses an input context, which makes the IME show its overlay again after ~2s. So the first click may briefly succeed before the overlay reappears, and subsequent clicks fail. The minimal reproducer above avoids this feedback loop.

Expected behavior

A mapped, non-focusable UTILITY overlay window should not prevent the dock tray popup from opening. The presence of such a window is unrelated to tray functionality.

Root cause analysis (upstream-side, inferred)

At X level everything is correct: event delivery, no grab, no geometric overlap with the dock, and window name/WM_CLASS are not the discriminator (renaming the window to arbitrary names still reproduces).

The suppression therefore appears to happen in dde-shell's click→popup decision: before opening the tray panel, it likely checks for "active input method / floating overlay" windows — e.g. by scanning mapped UTILITY/DOCK windows or querying focus state — and decides not to open when such a window is present. A kwin focus/raise quirk for not-focusable UTILITY windows may also pollute that decision.

Additional clue: a different overlay window of the same application that carries _NET_WM_STATE = ABOVE, SKIP_TASKBAR, SKIP_PAGER does not trigger the suppression. This suggests the specific attribute combination (UTILITY + not-focusable + empty _NET_WM_STATE + managed-by-WM) is the trigger.

Workaround used on our side

Making the toolbar window override-redirect (not managed by the WM, absent from _NET_CLIENT_LIST) avoids the suppression: dde-shell no longer sees a mapped client window and the tray works. This confirms the trigger is the managed UTILITY window itself, not the process or the click path.

Suggested fix / question for maintainers

Could dde-shell avoid treating a non-focusable UTILITY overlay as an "input method active" condition when deciding whether to open the tray popup? Or clarify which window-state combination the dock uses for that decision, so applications can set the appropriate hints.

We are happy to provide a minimal C/Xlib reproducer or further X traces if useful.

Reply Favorite View the author
All Replies
avatar
𰻞𰻝面
deepin
2026-11-25 08:12
#1

输入法图标会随着微信、QQ等软件的隐藏而在下次重启会话后隐藏,拉出来后微信、QQ等软件也会在下次会话中显示sob

Reply View the author
avatar
chana4afk
deepin
2026-11-25 14:35
#2

https://github.com/linuxdeepin/dde-shell/issues/1870

Reply View the author
avatar
chana4afk
deepin
2026-11-25 14:39
#3
𰻞𰻝面:

输入法图标会随着微信、QQ等软件的隐藏而在下次重启会话后隐藏,拉出来后微信、QQ等软件也会在下次会话中显示sob

不是你说的问题哦,请再看看issue,是输入法被dde-shell的bug,造成了无论输入法的工具条在屏幕哪个位置都会无法打开应用托盘哦

Reply View the author
avatar
chana4afk
deepin
2026-11-25 14:44
#4
chana4afk:

不是你说的问题哦,请再看看issue,是输入法被dde-shell的bug,造成了无论输入法的工具条在屏幕哪个位置都会无法打开应用托盘哦

已上架了应用市场,你们可以下载体验,输入法目录里仅保留字研输入法哈。一测一个准。
image.png

Reply View the author
avatar
chana4afk
deepin
2026-11-25 14:45
#5

中文版 issue(发 deepin 社区用)

对应已投递的英文 issue:https://github.com/linuxdeepin/dde-shell/issues/1870 标题:[dock] 存在一个不可聚焦的 UTILITY 浮层窗口映射时,应用托盘弹窗被抑制 说明:本中文版已脱敏(无内部人名/团队名/项目代号/本地路径/凭据),技术术语保留英文原名,便于与上游代码对照。可直接复制到社区发帖。


问题描述

在 deepin/UOS(dde-shell + kwin,X11 会话)上,只要有一个第三方输入法保持一个不可聚焦的 UTILITY 浮层窗口处于映射(mapped)状态(候选窗/工具条),dock 的应用托盘弹窗(点击右下角 ^ 按钮打开的 dde-shell/panelpopup)就无法弹出;该浮层窗口隐藏后,托盘弹窗恢复正常。

该失效与浮层窗口的屏幕位置无关——把浮层移到任意位置(甚至屏幕外)都不能恢复托盘;也与输入法进程本身无关——只销毁该浮层窗口(保持输入法其余部分存活)托盘立即恢复,重新映射该窗口后故障复现。

X11 层的事件路由经核实是正常的:点击 ^ 箭头的 ButtonPress 正确送达 dock 窗口(用纯 XTest 注入 + XRecord delivered_events 确认),没有活动的指针 grab,DBus XEventMonitor 也能收到该点击。点击确实送达了,但 dde-shell 没有弹出面板。

环境

  • 系统:deepin/UOS(dde-shell 面板/dock、kwin_x11、X11 会话)
  • dde-shell dock 位于屏幕底部(约 48–56px),_NET_WORKAREA 报告底部保留区
  • 复现分辨率 1920x1080,缩放 1.0
  • 触发方是一个基于 SDL 浮层窗口的第三方输入法(下面的最小复现不需要输入法)

复现步骤

  1. 创建一个具有以下属性的普通 X11 窗口(无需输入法):
    • _NET_WM_WINDOW_TYPE = _NET_WM_WINDOW_TYPE_UTILITY
    • WM_HINTS input = False(不可聚焦)
    • _NET_WM_STATE 为空
    • 处于 mapped 状态并留在屏幕上(位置无关紧要)
    • override-redirect = False(受窗口管理器管理)
  2. 点击 dock 右下角的 ^ 托盘按钮。
  3. 观察 dde-shell/panelpopup 是否弹出。

**实际结果:**只要这样的窗口处于 mapped 状态,托盘弹窗就不弹出(一直保持关闭态的 10x10 尺寸)。把该窗口 unmap(或关闭)→ 弹窗立即以正常尺寸和图标弹出。再次 map → 故障复现。

**关于"自锁"的说明:**在真实输入法场景中,"点托盘"这个动作本身会让某个输入上下文获得焦点,导致输入法在约 2 秒后再次显示其浮层。因此第一次点击可能在浮层重现前短暂成功,后续点击则失败。上面的最小复现规避了这个反馈循环。

期望行为

一个处于 mapped 状态的、不可聚焦的 UTILITY 浮层窗口,不应阻止 dock 托盘弹窗的打开。这类窗口的存在与托盘功能无关。

根因分析(上游侧,推断)

X 层一切正常:事件投递、无 grab、与 dock 无几何重叠、窗口名/WM_CLASS 不是判别因素(把窗口改成任意名字仍能复现)。

因此抑制很可能发生在 dde-shell 的"点击 → 弹面板"决策逻辑内:在展开托盘面板前,它可能检查是否存在"活跃的输入法/浮层窗口"(例如遍历 mapped 的 UTILITY/DOCK 窗口或查询焦点状态),发现这类窗口后决定不弹出。kwin 对不可聚焦 UTILITY 窗口的焦点/raise 处理异常也可能污染该判断。

补充线索:同一应用的另一个浮层窗口带有 _NET_WM_STATE = ABOVE, SKIP_TASKBAR, SKIP_PAGER 时不会触发抑制。这说明触发条件是特定的属性组合(UTILITY + 不可聚焦 + 空 _NET_WM_STATE + 受 WM 管理)。

我们这边采用的规避方案

把工具条窗口改为 override-redirect(不受 WM 管理、不出现在 _NET_CLIENT_LIST 中)即可避开抑制:dde-shell 不再看到这个 mapped 的 client 窗口,托盘恢复正常。这进一步证实触发因素是"受 WM 管理的 UTILITY 窗口"本身,而非进程或点击路径。

给维护者的建议 / 问题

dde-shell 在决定是否打开托盘弹窗时,能否不要把"不可聚焦的 UTILITY 浮层"当作"输入法处于激活"的条件?或者请说明 dock 在该判断中使用的是哪种窗口状态组合,以便应用正确设置 hint。

如有需要,我们可以提供一个最小的 C/Xlib 复现程序,或更多 X 事件追踪数据。

Reply View the author