Repository navigation
Conversation
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
ab6ccb8 to
7f2e8af
Compare
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
7f2e8af to
7930ea5
Compare
|
Reviewer's GuideImplementationMerge 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.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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>| if (mergedMask == currentMask) | ||
| return; | ||
|
|
||
| uint32_t value_list[] = { mergedMask }; |
There was a problem hiding this comment.
🟠 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.| xcb_get_window_attributes_reply_t *attributes = xcb_get_window_attributes_reply( | ||
| m_connection, xcb_get_window_attributes(m_connection, window), &error); |
There was a problem hiding this comment.
🟡 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.| 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); |
There was a problem hiding this comment.
🟡 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.
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 事件订阅
替换整个掩码。
Log: 监听窗口时保留 Qt 的 X11 事件订阅,保证智能隐藏正常工作。
Influence: 智能隐藏正常生效,启动器和弹窗保持正常的输入与失焦关闭行为。
PMS: BUG-383253
Summary by Sourcery
Preserve existing X11 event subscriptions when monitoring windows for dock smart hide.
Bug Fixes:
Enhancements: