Skip to content

fix(dock): preserve X11 event subscriptions in smart hide - #1852

Open
Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/bug-383253
Open

Ivy233 wants to merge 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/bug-383253

Conversation

@Ivy233

@Ivy233 Ivy233 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
  1. Read the event mask already selected on Qt's X11 connection with xcb_get_window_attributes, then merge the property, structure and visibility events required by smart hide instead of replacing the whole mask.
  2. Keep Qt's focus, keyboard, button and exposure subscriptions intact, so the launcher still receives input and popups close when they lose focus.
  3. Skip the update when the mask query fails or the merged mask is unchanged, avoiding any loss of existing subscriptions.
  4. Bump the Debian changelog to 6.2.1+smarthidefix1 for this fix.

Log: Preserve Qt's X11 event subscriptions while monitoring windows for smart hide.
Influence: Smart hide keeps working, and the launcher and popups retain normal input and focus-out behavior.

fix(dock): 智能隐藏监听窗口时保留 X11 事件订阅

  1. 使用 xcb_get_window_attributes 读取 Qt 的 X11 连接上已选择的事件 掩码,将智能隐藏所需的属性变化、结构变化和可见性事件合并进去,而不是
    替换整个掩码。
  2. 保留 Qt 自身的焦点、键盘、鼠标按键和重绘(Expose)订阅,使启动器 仍能接收输入,弹窗失焦时也能正常关闭。
  3. 当事件掩码查询失败或合并后的掩码未变化时跳过更新,避免丢失已有 订阅。

Log: 监听窗口时保留 Qt 的 X11 事件订阅,保证智能隐藏正常工作。
Influence: 智能隐藏正常生效,启动器和弹窗保持正常的输入与失焦关闭行为。
PMS: BUG-383253

Summary by Sourcery

Preserve existing X11 event subscriptions when monitoring windows for dock smart hide.

Bug Fixes:

  • Preserve Qt’s existing X11 event subscriptions while adding the event monitoring required by dock smart hide, maintaining launcher input and popup focus-out behavior.

Enhancements:

  • Avoid unnecessary event-mask updates and safely skip changes when the X11 mask query fails.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Ivy233

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

1. Read the event mask already selected on Qt's X11 connection with
xcb_get_window_attributes, then merge the property, structure and
visibility events required by smart hide instead of replacing the whole
mask.
2. Keep Qt's focus, keyboard, button and exposure subscriptions intact,
so the launcher still receives input and popups close when they lose
focus.
3. Skip the update when the mask query fails or the merged mask is
unchanged, avoiding any loss of existing subscriptions.

Log: Preserve Qt's X11 event subscriptions while monitoring windows for
smart hide.
Influence: Smart hide keeps working, and the launcher and popups retain
normal input and focus-out behavior.

fix(dock): 智能隐藏监听窗口时保留 X11 事件订阅

1. 使用 xcb_get_window_attributes 读取 Qt 的 X11 连接上已选择的事件
掩码,将智能隐藏所需的属性变化、结构变化和可见性事件合并进去,而不是
替换整个掩码。
2. 保留 Qt 自身的焦点、键盘、鼠标按键和重绘(Expose)订阅,使启动器
仍能接收输入,弹窗失焦时也能正常关闭。
3. 当事件掩码查询失败或合并后的掩码未变化时跳过更新,避免丢失已有
订阅。

Log: 监听窗口时保留 Qt 的 X11 事件订阅,保证智能隐藏正常工作。
Influence: 智能隐藏正常生效,启动器和弹窗保持正常的输入与失焦关闭行为。
PMS: BUG-383253
@deepin-ci-robot

deepin-ci-robot commented Nov 24, 2026 •

Copy link
Copy Markdown

⚠️ OBS CI 构建警告日志 (Commit: 7930ea5b)

提示:以下为 OBS CI 构建中 Lintian 检测到的警告信息,默认折叠,点击展开查看详情。完整日志请参阅对应构建状态链接。

deepin_develop / aarch64 (Lintian 警告: 15 条)
[  845s] W: dde-shell: desktop-command-not-in-package bin/false [usr/share/applications/org.deepin.dde-shell.desktop]
[  845s] N: 
[  845s] N:   The desktop entry specifies a Command that does not match any of the
[  845s] N:   executables shipped in the package.
[  845s] N:   
[  845s] N:   This condition is often caused by a typo, or the desktop file was not
[  845s] N:   updated after the installed path of the executable was modified.
[  845s] N:   
[  845s] N:   Packages should ship executables that are used as commands in desktop
[  845s] N:   files.
[  845s] N: 
[  845s] N:   Visibility: warning
[  845s] N:   Show-Always: no
[  845s] N:   Check: menu-format
[  845s] N: 
[  845s] N:
[  845s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/aarch64-linux-gnu/libds-notification-shared.so.2.0.61 [usr/lib/aarch64-linux-gnu/libds-notification-shared.so]
[  845s] N: 
[  845s] N:   Although this package is not a "-dev" package, it installs a
[  845s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[  845s] N:   library. When the link doesn't include the version number, it is used by
[  845s] N:   the linker when other programs are built against this shared library.
[  845s] N:   
[  845s] N:   Shared libraries are supposed to place such symbolic links in their
[  845s] N:   respective "-dev" packages, so it is a bug to include it with the main
[  845s] N:   library package.
[  845s] N:   
[  845s] N:   However, if this is a small package which includes the runtime and the
[  845s] N:   development libraries, this is not a bug. In the latter case, please
[  845s] N:   override this warning.
[  845s] N: 
[  845s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[  845s] N:   Manual for details.
[  845s] N: 
[  845s] N:   Visibility: warning
[  845s] N:   Show-Always: no
[  845s] N:   Check: libraries/shared/links
[  845s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[  845s] N: 
[  845s] N:
[  845s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[  845s] N: 
[  845s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[  845s] N:   a manual page
[  845s] N:   
[  845s] N:   Note that though the man program has the capability to check for several
[  845s] N:   program names in the NAMES section, each of these programs should have its
[  845s] N:   own manual page (a symbolic link to the appropriate manual page is
[  845s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[  845s] N:   support this.
[  845s] N:   
[  845s] N:   If the name of the manual page differs from the binary by case, man may be
[  845s] N:   able to find it anyway; however, it is still best practice to match the
[  845s] N:   exact capitalization of the executable in the manual page.
[  845s] N:   
[  845s] N:   If the manual pages are provided by another package on which this package
[  845s] N:   depends, Lintian may not be able to determine that manual pages are
[  845s] N:   available. In this case, after confirming that all binaries do have manual
[  845s] N:   pages after this package and its dependencies are installed, please add a
[  845s] N:   Lintian override.
[  845s] N: 
[  845s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[  845s] N:   for details.
[  845s] N: 
[  845s] N:   Visibility: warning
[  845s] N:   Show-Always: no
[  845s] N:   Check: documentation/manual
[  845s] N:   Renamed from: binary-without-manpage
[  845s] N: 
[  845s] N:
[  845s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[  845s] N: 
[  845s] N:   When you NMU a package, that fact should be mentioned on the first line in
[  845s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[  845s] N:   insensitive).
[  845s] N:   
[  845s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  845s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  845s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  845s] N:   package (not intended for Debian), you can suppress this warning by
[  845s] N:   putting "local" in the version number or "local package" on the first line
[  845s] N:   of the changelog entry.
[  845s] N: 
[  845s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[  845s] N:   Developer's Reference for details.
[  845s] N: 
[  845s] N:   Visibility: warning
[  845s] N:   Show-Always: no
[  845s] N:   Check: nmu
[  845s] N:   Renamed from: changelog-should-mention-nmu
[  845s] N: 
[  845s] N:
[  845s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[  845s] N: 
[  845s] N:   The package name of a library package should usually reflect the soname of
[  845s] N:   the included library. The package name can determined from the library
[  845s] N:   file name with the following code snippet:
[  845s] N:   
[  845s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[  845s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[  845s] N: 
[  845s] N:   Visibility: warning
[  845s] N:   Show-Always: no
[  845s] N:   Check: libraries/shared/soname
[  845s] N: 
[  845s] N:
[  845s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[  845s] N:
[  845s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[  845s] N:
[  845s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.61+u033 [debian/changelog:1]
[  845s] N: 
[  845s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[  845s] N:   native package). This is to prevent stealing version numbers from the
[  845s] N:   maintainer.
[  845s] N:   
[  845s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  845s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  845s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  845s] N:   package (not intended for Debian), you can suppress this warning by
[  845s] N:   putting "local" in the version number or "local package" on the first line
[  845s] N:   of the changelog entry.
[  845s] N: 
[  845s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[  845s] N:   Developer's Reference for details.
[  845s] N: 
[  845s] N:   Visibility: warning
[  845s] N:   Show-Always: no
[  845s] N:   Check: nmu
[  845s] N: 
[  845s] N:
[  845s] W: dde-shell: unknown-section DDE
[  845s] N: 
[  845s] N:   The "Section:" field in this package's control file is not one of the
[  845s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[  845s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[  845s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[  845s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[  845s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[  845s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[  845s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[  845s] N:   
[  845s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[  845s] N:   "non-free-firmware/" if the package is in the according archive area.
[  845s] N: 
[  845s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[  845s] N:   details.
[  845s] N: 
[  845s] N:   Visibility: warning
[  845s] N:   Show-Always: no
[  845s] N:   Check: fields/section
[  845s] N: 
[  845s] N:
[  845s] W: dde-shell-example: unknown-section DDE
[  845s] N:
[  845s] W: libdde-shell: unknown-section DDE
[  845s] N:
[  845s] W: libdde-shell-dev: unknown-section DDE
[  845s] N:
[  845s] W: libdde-shell-dock: unknown-section DDE
[  845s] N:
[  845s] W: libdde-shell-dock-dev: unknown-section DDE
[  846s] Warning: mkbaselibs missing in build root, skipping baselibs
deepin_develop / x86_64 (Lintian 警告: 15 条)
[  392s] W: dde-shell: desktop-command-not-in-package bin/false [usr/share/applications/org.deepin.dde-shell.desktop]
[  392s] N: 
[  392s] N:   The desktop entry specifies a Command that does not match any of the
[  392s] N:   executables shipped in the package.
[  392s] N:   
[  392s] N:   This condition is often caused by a typo, or the desktop file was not
[  392s] N:   updated after the installed path of the executable was modified.
[  392s] N:   
[  392s] N:   Packages should ship executables that are used as commands in desktop
[  392s] N:   files.
[  392s] N: 
[  392s] N:   Visibility: warning
[  392s] N:   Show-Always: no
[  392s] N:   Check: menu-format
[  392s] N: 
[  392s] N:
[  392s] W: dde-shell: link-to-shared-library-in-wrong-package usr/lib/x86_64-linux-gnu/libds-notification-shared.so.2.0.61 [usr/lib/x86_64-linux-gnu/libds-notification-shared.so]
[  392s] N: 
[  392s] N:   Although this package is not a "-dev" package, it installs a
[  392s] N:   "libsomething.so" symbolic link referencing the corresponding shared
[  392s] N:   library. When the link doesn't include the version number, it is used by
[  392s] N:   the linker when other programs are built against this shared library.
[  392s] N:   
[  392s] N:   Shared libraries are supposed to place such symbolic links in their
[  392s] N:   respective "-dev" packages, so it is a bug to include it with the main
[  392s] N:   library package.
[  392s] N:   
[  392s] N:   However, if this is a small package which includes the runtime and the
[  392s] N:   development libraries, this is not a bug. In the latter case, please
[  392s] N:   override this warning.
[  392s] N: 
[  392s] N:   Please refer to Development files (Section 8.4) in the Debian Policy
[  392s] N:   Manual for details.
[  392s] N: 
[  392s] N:   Visibility: warning
[  392s] N:   Show-Always: no
[  392s] N:   Check: libraries/shared/links
[  392s] N:   Renamed from: non-dev-pkg-with-shlib-symlink
[  392s] N: 
[  392s] N:
[  392s] W: dde-shell: no-manual-page [usr/bin/dde-shell]
[  392s] N: 
[  392s] N:   Each binary in /usr/bin, /usr/sbin, /bin, /sbin or /usr/games should have
[  392s] N:   a manual page
[  392s] N:   
[  392s] N:   Note that though the man program has the capability to check for several
[  392s] N:   program names in the NAMES section, each of these programs should have its
[  392s] N:   own manual page (a symbolic link to the appropriate manual page is
[  392s] N:   sufficient) because other manual page viewers such as xman or tkman don't
[  392s] N:   support this.
[  392s] N:   
[  392s] N:   If the name of the manual page differs from the binary by case, man may be
[  392s] N:   able to find it anyway; however, it is still best practice to match the
[  392s] N:   exact capitalization of the executable in the manual page.
[  392s] N:   
[  392s] N:   If the manual pages are provided by another package on which this package
[  392s] N:   depends, Lintian may not be able to determine that manual pages are
[  392s] N:   available. In this case, after confirming that all binaries do have manual
[  392s] N:   pages after this package and its dependencies are installed, please add a
[  392s] N:   Lintian override.
[  392s] N: 
[  392s] N:   Please refer to Manual pages (Section 12.1) in the Debian Policy Manual
[  392s] N:   for details.
[  392s] N: 
[  392s] N:   Visibility: warning
[  392s] N:   Show-Always: no
[  392s] N:   Check: documentation/manual
[  392s] N:   Renamed from: binary-without-manpage
[  392s] N: 
[  392s] N:
[  392s] W: dde-shell source: no-nmu-in-changelog [debian/changelog:1]
[  392s] N: 
[  392s] N:   When you NMU a package, that fact should be mentioned on the first line in
[  392s] N:   the changelog entry. Use the words "NMU" or "Non-maintainer upload" (case
[  392s] N:   insensitive).
[  392s] N:   
[  392s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  392s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  392s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  392s] N:   package (not intended for Debian), you can suppress this warning by
[  392s] N:   putting "local" in the version number or "local package" on the first line
[  392s] N:   of the changelog entry.
[  392s] N: 
[  392s] N:   Please refer to Using the DELAYED/ queue (Section 5.11.3) in the Debian
[  392s] N:   Developer's Reference for details.
[  392s] N: 
[  392s] N:   Visibility: warning
[  392s] N:   Show-Always: no
[  392s] N:   Check: nmu
[  392s] N:   Renamed from: changelog-should-mention-nmu
[  392s] N: 
[  392s] N:
[  392s] W: dde-shell: package-name-doesnt-match-sonames libds-notification-shared2
[  392s] N: 
[  392s] N:   The package name of a library package should usually reflect the soname of
[  392s] N:   the included library. The package name can determined from the library
[  392s] N:   file name with the following code snippet:
[  392s] N:   
[  392s] N:    $ objdump -p /path/to/libfoo-bar.so.1.2.3 | sed -n -e's/^[[:space:]]*SONAME[[:space:]]*//p' | \
[  392s] N:        sed -r -e's/([0-9])\.so\./\1-/; s/\.so(\.|$)//; y/_/-/; s/(.*)/\L&/'
[  392s] N: 
[  392s] N:   Visibility: warning
[  392s] N:   Show-Always: no
[  392s] N:   Check: libraries/shared/soname
[  392s] N: 
[  392s] N:
[  392s] W: libdde-shell: package-name-doesnt-match-sonames libdde-shell1
[  392s] N:
[  392s] W: libdde-shell-dock: package-name-doesnt-match-sonames libdde-shell-dock1
[  392s] N:
[  392s] W: dde-shell source: source-nmu-has-incorrect-version-number 2.0.61+u033 [debian/changelog:1]
[  392s] N: 
[  392s] N:   A source NMU should have a Debian revision of "-x.x" (or "+nmuX" for a
[  392s] N:   native package). This is to prevent stealing version numbers from the
[  392s] N:   maintainer.
[  392s] N:   
[  392s] N:   Maybe you didn't intend this upload to be a NMU, in that case, please
[  392s] N:   double-check that the most recent entry in the changelog is byte-for-byte
[  392s] N:   identical to the maintainer or one of the uploaders. If this is a local
[  392s] N:   package (not intended for Debian), you can suppress this warning by
[  392s] N:   putting "local" in the version number or "local package" on the first line
[  392s] N:   of the changelog entry.
[  392s] N: 
[  392s] N:   Please refer to NMUs and debian/changelog (Section 5.11.2) in the Debian
[  392s] N:   Developer's Reference for details.
[  392s] N: 
[  392s] N:   Visibility: warning
[  392s] N:   Show-Always: no
[  392s] N:   Check: nmu
[  392s] N: 
[  392s] N:
[  392s] W: dde-shell: unknown-section DDE
[  392s] N: 
[  392s] N:   The "Section:" field in this package's control file is not one of the
[  392s] N:   sections in use on the ftp archive. Valid sections are currently admin,
[  392s] N:   comm, cli-mono, database, debug, devel, doc, editors, electronics,
[  392s] N:   embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio,
[  392s] N:   haskell, httpd, interpreters, java, javascript, kde, libdevel, libs, lisp,
[  392s] N:   localization, kernel, mail, math, misc, net, news, ocaml, oldlibs,
[  392s] N:   otherosfs, perl, php, python, ruby, rust, science, shells, sound, tex,
[  392s] N:   text, utils, vcs, video, web, x11, xfce, zope.
[  392s] N:   
[  392s] N:   The section name should be preceded by either "contrib/", "non-free/" or
[  392s] N:   "non-free-firmware/" if the package is in the according archive area.
[  392s] N: 
[  392s] N:   Please refer to Sections (Section 2.4) in the Debian Policy Manual for
[  392s] N:   details.
[  392s] N: 
[  392s] N:   Visibility: warning
[  392s] N:   Show-Always: no
[  392s] N:   Check: fields/section
[  392s] N: 
[  392s] N:
[  392s] W: dde-shell-example: unknown-section DDE
[  392s] N:
[  392s] W: libdde-shell: unknown-section DDE
[  392s] N:
[  392s] W: libdde-shell-dev: unknown-section DDE
[  392s] N:
[  392s] W: libdde-shell-dock: unknown-section DDE
[  392s] N:
[  392s] W: libdde-shell-dock-dev: unknown-section DDE
[  392s] Warning: mkbaselibs missing in build root, skipping baselibs

@sourcery-ai

sourcery-ai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Merge smart-hide event subscriptions into Qt’s existing X11 window mask so the update preserves Qt’s selected events and is skipped when querying fails or no change is needed.

  • panels/dock/x11dockhelper.cpp L312-335

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="panels/dock/x11dockhelper.cpp" line_range="335" />
<code_context>
+    if (mergedMask == currentMask)
+        return;
+
+    uint32_t value_list[] = { mergedMask };
     xcb_change_window_attributes(m_connection, window, XCB_CW_EVENT_MASK, value_list);
 };
</code_context>
<issue_to_address>
**Qt event handling breaks**

When another monitor registers, maps, or adds a window after Qt has selected input or focus events for it, `XcbGetInfo::addWindows` and `X11WindowMonitor::onWindowMapped` replace the event mask on the shared Qt X11 connection with only property, structure, and visibility events, removing Qt’s subscriptions and breaking input or focus-out handling.

Update both monitors to preserve and merge the window’s existing event mask instead of replacing it.
</issue_to_address>

### Comment 2
<location path="panels/dock/x11dockhelper.cpp" line_range="318-319" />
<code_context>
+    // silently drop Qt's own subscriptions (focus, keyboard, buttons, exposure), so
+    // merge the events we need into the mask that this client already selected.
+    xcb_generic_error_t *error = nullptr;
+    xcb_get_window_attributes_reply_t *attributes = xcb_get_window_attributes_reply(
+        m_connection, xcb_get_window_attributes(m_connection, window), &error);
+    if (!attributes) {
+        if (error) {
</code_context>
<issue_to_address>
**Window scans stall the dock**

When smart hide initializes or many windows are added, especially over a high-latency X11 connection, `onWindowClientListChanged` calls `monitorWindowChange` for each new window, and each synchronous `xcb_get_window_attributes_reply` waits for a server round trip on the dock’s GUI event thread, delaying UI work.

Use asynchronous or batched attribute queries so scanning windows does not block the GUI thread for a round trip per window.
</issue_to_address>

### Comment 3
<location path="panels/dock/x11dockhelper.cpp" line_range="312-336" />
<code_context>
+    const uint32_t monitorMask = XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_VISIBILITY_CHANGE;
</code_context>
<issue_to_address>
**Requested package version is missing**

`debian/changelog` remains at `dde-shell (2.0.61)`, so building this change does not produce the requested `6.2.1+smarthidefix1` package version and the changelog does not record this fix.

Add a Debian changelog entry with version `6.2.1+smarthidefix1` describing this fix.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

if (mergedMask == currentMask)
return;

uint32_t value_list[] = { mergedMask };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Qt event handling breaks

When another monitor registers, maps, or adds a window after Qt has selected input or focus events for it, XcbGetInfo::addWindows and X11WindowMonitor::onWindowMapped replace the event mask on the shared Qt X11 connection with only property, structure, and visibility events, removing Qt’s subscriptions and breaking input or focus-out handling.

Update both monitors to preserve and merge the window’s existing event mask instead of replacing it.

Prompt for AI agents
In `panels/dock/x11dockhelper.cpp` at line 335:

**Qt event handling breaks**

When another monitor registers, maps, or adds a window after Qt has selected input or focus events for it, `XcbGetInfo::addWindows` and `X11WindowMonitor::onWindowMapped` replace the event mask on the shared Qt X11 connection with only property, structure, and visibility events, removing Qt’s subscriptions and breaking input or focus-out handling.

Update both monitors to preserve and merge the window’s existing event mask instead of replacing it.

Comment on lines +318 to +319
xcb_get_window_attributes_reply_t *attributes = xcb_get_window_attributes_reply(
m_connection, xcb_get_window_attributes(m_connection, window), &error);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Window scans stall the dock

When smart hide initializes or many windows are added, especially over a high-latency X11 connection, onWindowClientListChanged calls monitorWindowChange for each new window, and each synchronous xcb_get_window_attributes_reply waits for a server round trip on the dock’s GUI event thread, delaying UI work.

Use asynchronous or batched attribute queries so scanning windows does not block the GUI thread for a round trip per window.

Prompt for AI agents
In `panels/dock/x11dockhelper.cpp` at lines 318-319:

**Window scans stall the dock**

When smart hide initializes or many windows are added, especially over a high-latency X11 connection, `onWindowClientListChanged` calls `monitorWindowChange` for each new window, and each synchronous `xcb_get_window_attributes_reply` waits for a server round trip on the dock’s GUI event thread, delaying UI work.

Use asynchronous or batched attribute queries so scanning windows does not block the GUI thread for a round trip per window.

Comment on lines +312 to 336
const uint32_t monitorMask = XCB_EVENT_MASK_PROPERTY_CHANGE | XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_VISIBILITY_CHANGE;

// This runs on the connection owned by Qt. Replacing the whole event mask would
// silently drop Qt's own subscriptions (focus, keyboard, buttons, exposure), so
// merge the events we need into the mask that this client already selected.
xcb_generic_error_t *error = nullptr;
xcb_get_window_attributes_reply_t *attributes = xcb_get_window_attributes_reply(
m_connection, xcb_get_window_attributes(m_connection, window), &error);
if (!attributes) {
if (error) {
qCWarning(dockX11Log) << "failed to query event mask of window" << window << "error" << error->error_code;
free(error);
}
return;
}

const uint32_t currentMask = attributes->your_event_mask;
free(attributes);

const uint32_t mergedMask = currentMask | monitorMask;
if (mergedMask == currentMask)
return;

uint32_t value_list[] = { mergedMask };
xcb_change_window_attributes(m_connection, window, XCB_CW_EVENT_MASK, value_list);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Requested package version is missing

debian/changelog remains at dde-shell (2.0.61), so building this change does not produce the requested 6.2.1+smarthidefix1 package version and the changelog does not record this fix.

Add a Debian changelog entry with version 6.2.1+smarthidefix1 describing this fix.

Prompt for AI agents
In `panels/dock/x11dockhelper.cpp` at lines 312-336:

**Requested package version is missing**

`debian/changelog` remains at `dde-shell (2.0.61)`, so building this change does not produce the requested `6.2.1+smarthidefix1` package version and the changelog does not record this fix.

Add a Debian changelog entry with version `6.2.1+smarthidefix1` describing this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants