Repository navigation
fix(osd): speed up checkmark updates during Super+P cycling - #1881
deepin-bot[bot] merged 1 commit into
Conversation
Reviewer's GuideUses of the APIHandle repeated SwitchMonitors requests before syncing display state, so each eligible press advances the checkmark without an unnecessary synchronous refresh.
ImplementationTrack the default audio sink and update cached volume and mute state from D-Bus notifications so the audio OSD reflects live changes without repeatedly fetching mute state for its icon.
Refresh and validate the display-mode candidate list on demand, advance the cached selection on repeat presses, and retain the chosen mode until the action timer applies it.
Replace the queued hide callback with a cancellable timer and dispatch OSD requests immediately, preventing an earlier hide from shortening a newer request.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/notification/osd/displaymode/package/main.qml" line_range="31-33" />
<code_context>
-
- if (osdType === "DirectSwitchLayout") {
- if (Applet.state !== 2) {
- Applet.doAction()
- }
- } else if (osdType === "SwitchMonitors") {
- if (Panel.lastOsdType() === osdType) {
- Applet.next()
- }
- }
+ if (!match(osdType))
+ return false
+ if (osdType === "SwitchMonitors" && Panel.lastOsdType() === osdType) {
+ Applet.next()
return true
}
- return false
</code_context>
<issue_to_address>
**Unwanted display-mode OSD appears**
When a `DirectSwitchLayout` request is dispatched, `update()` now returns `true` for `DirectSwitchLayout`, so the parent OSD package activates this applet even though this path only syncs and optionally applies the mode; users see the display-mode selection overlay for a direct-switch request.
Preserve the false return for `DirectSwitchLayout` if that request should apply the mode without activating the display-mode OSD.
</issue_to_address>
### Comment 2
<location path="panels/notification/osd/osdpanel.cpp" line_range="78" />
<code_context>
+ // Keep repeat presses behind any OSD requests already scheduled for delivery.
+ if (m_visible && m_pendingDispatches == 0 && text == QLatin1String("SwitchMonitors")
+ && m_lastOsdType == text) {
+ dispatch();
+ return;
+ }
</code_context>
<issue_to_address>
**New cycling OSD hides prematurely**
When a new SwitchMonitors request arrives after `doneSetting()` has queued a hide but before that hide runs, `dispatch()` calls `showOsd()`, which restarts `m_osdTimer` but does not cancel a hide already scheduled by `doneSetting()`; that stale callback hides the OSD at its original deadline, so the user loses the checkmark before cycling finishes.
Cancel or invalidate pending hide callbacks whenever `showOsd()` displays or refreshes the OSD.
</issue_to_address>| Applet.doAction() | ||
|
|
||
| return true |
There was a problem hiding this comment.
🟡 Medium · Unwanted display-mode OSD appears
When a DirectSwitchLayout request is dispatched, update() now returns true for DirectSwitchLayout, so the parent OSD package activates this applet even though this path only syncs and optionally applies the mode; users see the display-mode selection overlay for a direct-switch request.
Preserve the false return for DirectSwitchLayout if that request should apply the mode without activating the display-mode OSD.
Prompt for AI agents
In `panels/notification/osd/displaymode/package/main.qml` at lines 31-33:
**Unwanted display-mode OSD appears**
When a `DirectSwitchLayout` request is dispatched, `update()` now returns `true` for `DirectSwitchLayout`, so the parent OSD package activates this applet even though this path only syncs and optionally applies the mode; users see the display-mode selection overlay for a direct-switch request.
Preserve the false return for `DirectSwitchLayout` if that request should apply the mode without activating the display-mode OSD.
|
375ff90 to
3abcf51
Compare
1. Dispatch OSD requests immediately by removing the fixed 100 ms delay. 2. Read display state on open. Advance the checkmark from the cached list on repeat presses and apply the final selection after two seconds. 3. Retry failed list reads. Start from the first item if the active mode or primary output is unknown. 4. Update audio OSD from Volume and Mute notifications. Refresh volume, mute and the volume boost setting when the default output changes. Log: Improve Super+P checkmark response and refresh audio OSD on changes Influence: 1. Verify the first Super+P press shows the active display mode. 2. Hold Super and tap P repeatedly. Verify the checkmark advances and only the final selection is applied after two seconds. 3. Verify recovery after a failed display list or mode read. 4. Test volume up from zero, mute and switching the default audio output while the OSD is visible. Check the progress bar and 100% mark. fix(osd): 加快 Super+P 切换显示模式时的勾选更新 1. 移除 OSD 固定的 100 ms 延时,收到请求后立即派发。 2. 首次打开读取显示状态,连按时用缓存列表推进勾选, 停按两秒后应用最后选中的模式。 3. 候选列表读取失败时重试,当前模式或主屏未知时从首项开始轮选。 4. 根据音量和静音通知补刷音量 OSD,默认输出切换时同时刷新 音量、静音和音量增强设置。 Influence: 1. 首按 Super+P,确认面板勾选当前模式。 2. 按住 Super 连按 P,确认勾选逐次推进,停按两秒只应用最后一项。 3. 验证候选列表或实际模式读取失败后仍能恢复轮选。 4. 验证音量从零回升、静音和面板可见时切换默认输出, 检查进度条和 100% 刻度是否正确。 Log: 加快 Super+P 勾选更新,并在音量状态变化后补刷面板 PMS: BUG-383567
3abcf51 to
88173d8
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb, wjyrich 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 |
|
/forcemerge |
d35fbb7
into
linuxdeepin:release/2500u2
|
This pr force merged! (status: unstable, merge_method: rebase) |
修复内容
验证
osdpanel和osd-displaymode编译通过,git diff --check通过。PMS: BUG-383567
Summary by Sourcery
Make rapid display-mode cycling responsive and reliable while keeping the OSD synchronized with display and audio state.
Bug Fixes:
Enhancements: