Repository navigation
fix(osd): speed up Super+P display-mode checkmarks - #1849
Conversation
Reviewer's GuideUses of the APIChange the display-mode OSD request flow so repeated monitor-switch requests advance the cached selection without synchronizing on every press.
ImplementationTrack display-list validity and refresh or advance display state so failed reads can recover and the final selection can be applied after the repeat sequence.
Dispatch OSD requests immediately and manage the visible-period and hide timers so a pending hide does not truncate a newer request.
Cache the active audio sink's mute and volume state, subscribe to property changes, and refresh audio OSD state when properties or the default sink change.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
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="25" />
<code_context>
- }
- } else if (osdType === "SwitchMonitors") {
- if (Panel.lastOsdType() === osdType) {
- Applet.next()
- }
- }
</code_context>
<issue_to_address>
**Repeat presses use stale choices**
When the initial output fetch fails and recovers, or outputs or the current mode change after sync while the OSD remains visible, `Applet.next()` advances the cached plan without calling `Applet.sync()`, so an empty plan stays empty and changed outputs or modes leave stale choices; the checkmark stays unchanged or points to the wrong choice, and the delayed action targets an unavailable or unintended mode.
Call `Applet.sync()` before `Applet.next()` on repeat presses.
Also at `panels/notification/osd/displaymode/package/main.qml:24`, `panels/notification/osd/displaymode/package/main.qml:26`, `panels/notification/osd/osdpanel.cpp:80`.
</issue_to_address>
|
202bb3c to
c19e4dc
Compare
| }; | ||
|
|
||
| // Keep repeat presses behind any OSD requests already scheduled for delivery. | ||
| if (m_visible && m_pendingDispatches == 0 && text == QLatin1String("SwitchMonitors") |
There was a problem hiding this comment.
osdpanel里不应该有SwitchMonitors这种插件里的类型判断,
17217df to
68c1bdb
Compare
|
@sourcery-ai review |
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/audio/audioapplet.cpp" line_range="10" />
<code_context>
#include "pluginfactory.h"
#include <QDBusConnection>
+#include <QDBusMessage>
#include <QDBusPendingCall>
#include <QDBusReply>
</code_context>
<issue_to_address>
**Audio change notifications stop**
When the session-bus connection cannot install the `PropertiesChanged` subscription, the failed subscription is not logged, retried, or re-established, so `onAudioPropertiesChanged` never receives later volume and mute updates and the OSD stays stale until an explicit sync.
Check the connection result and re-establish the subscription after the bus becomes available, logging failures.
</issue_to_address>
### Comment 2
<location path="panels/notification/osd/audio/audioapplet.cpp" line_range="110" />
<code_context>
{
- setVolumeValue(fetchVolume());
-
+ m_sinkPath = fetchDefaultSinkPath();
+ readSinkState(true, true);
setIncreaseVolume(fetchIncreaseVolume());
</code_context>
<issue_to_address>
**Audio state resets after lookup failure**
When the `DefaultSink` property is invalidated and the follow-up D-Bus read fails transiently, `fetchDefaultSinkPath()` returns an empty path, so `m_sinkPath` is cleared and `readSinkState()` resets the displayed volume and mute state; later sink notifications are rejected, leaving the OSD stale until another default-sink change or explicit sync.
Keep the current sink path and displayed state when the follow-up read fails, and retry the lookup instead of passing an empty path to `readSinkState()`.
</issue_to_address>570417f to
90cfbf5
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
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, 52cyb 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 |
|
This pr force merged! (status: blocked, merge_method: rebase) |
on repeat presses and apply the final selection after two seconds.
or primary output is unknown.
mute and the volume boost setting when the default output changes.
Log: Improve Super+P checkmark response and refresh audio OSD on changes
Influence:
only the final selection is applied after two seconds.
while the OSD is visible. Check the progress bar and 100% mark.
fix(osd): 加快 Super+P 切换显示模式时的勾选更新
停按两秒后应用最后选中的模式。
音量、静音和音量增强设置。
Influence:
检查进度条和 100% 刻度是否正确。
Log: 加快 Super+P 勾选更新,并在音量状态变化后补刷面板
PMS: BUG-383567
Summary by Sourcery
Improve OSD responsiveness and state synchronization for display-mode cycling and audio changes.
New Features:
Bug Fixes:
Enhancements: