Skip to content

fix: Enable mouse pass-through for main window in X11 recording mode#768

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:treelandcommit1
Nov 27, 2025
Merged

fix: Enable mouse pass-through for main window in X11 recording mode#768
deepin-bot[bot] merged 1 commit into
linuxdeepin:develop/snipefrom
dengzhongyuan365-dev:treelandcommit1

Conversation

@dengzhongyuan365-dev

Copy link
Copy Markdown
Member

fix: Enable mouse pass-through for main window in X11 recording mode

  • Added conditional logic to enable mouse pass-through for the main window when starting recording in X11 mode.
  • The pass-through is only activated when not in Wayland or Treeland modes, preventing interference with recording events.
  • Added Chinese comment explaining the X11-specific behavior for clarity.

This update ensures proper event handling during screen recording across different display server protocols.

- Added conditional logic to enable mouse pass-through for the main window when starting recording in X11 mode.
- The pass-through is only activated when not in Wayland or Treeland modes, preventing interference with recording events.
- Added Chinese comment explaining the X11-specific behavior for clarity.

This update ensures proper event handling during screen recording across different display server protocols.
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来对这个代码变更进行审查:

  1. 语法逻辑:
  • 代码语法正确,使用了条件判断语句来控制是否执行鼠标穿透功能
  • 逻辑上通过检查 isTreelandMode 来决定是否调用 passInputEvent,这是一个合理的条件判断
  1. 代码质量:
  • 代码注释清晰,说明了这是针对 X11 环境的特殊处理
  • 变量命名 isTreelandMode 具有自解释性
  • 代码缩进和格式符合规范
  1. 代码性能:
  • 这个改动不会对性能产生显著影响
  • 仅增加了一个条件判断的开销,可以忽略不计
  1. 代码安全:
  • 使用了 winId() 获取窗口ID,这是安全的Qt标准API
  • 条件判断避免了在不支持的环境中调用可能不安全的函数

改进建议:

  1. 建议将 isTreelandMode 的定义和文档说明补充完整,方便其他开发者理解这个变量的具体用途
  2. 考虑添加日志输出,在调试模式下记录是否成功执行了鼠标穿透设置
  3. 可以考虑将这个平台相关的代码移到单独的函数中,提高代码的可维护性
  4. 建议添加错误处理机制,以防 passInputEvent 调用失败

总体来说,这是一个合理的代码修改,针对特定平台(X11)的特殊需求进行了适配,代码质量良好。

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengzhongyuan365-dev, lzwind

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

@dengzhongyuan365-dev

Copy link
Copy Markdown
Member Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Nov 27, 2025

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot deepin-bot Bot merged commit 83bccbe into linuxdeepin:develop/snipe Nov 27, 2025
7 of 9 checks passed
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.

3 participants