fix(osd): read Wayland brightness from Treeland instead of Display1#1667
Conversation
There was a problem hiding this comment.
Sorry @yixinshark, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
bae633a to
e3d0639
Compare
e3d0639 to
596ea1e
Compare
On Wayland the org.deepin.dde.Display1 service is unavailable, so the brightness OSD always displayed 0%. Bind a read-only treeland_output_color_control_v1 to the primary wl_output through treeland_output_manager_v1, cache the compositor-reported brightness, and update it reactively from protocol events. Keep the Display1 query path on X11. Destroy the color-control and manager protocol objects during provider teardown to avoid stale Wayland listeners. 在 Wayland 下 org.deepin.dde.Display1 不可用,导致亮度 OSD 始终显示 0%。通过 treeland_output_manager_v1 为主屏幕绑定只读的 treeland_output_color_control_v1,缓存合成端上报的亮度,并通过协议事件实时更新;X11 下继续使用 Display1。Provider 析构时依次销毁颜色控制和管理器协议对象,避免残留 Wayland listener。 Log: read Wayland OSD brightness from Treeland
596ea1e to
b577ff9
Compare
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 void TreelandBrightness::refresh()
{
if (!isActive()) {
delete m_control;
m_control = nullptr;
m_output = nullptr;
return;
}
struct wl_output *output = primaryWlOutput();
if (m_control && m_output == output && output) {
return;
}
delete m_control;
m_control = nullptr;
// 延迟赋值 m_output,直到成功获取 control 对象
// m_output = output;
if (!output) {
m_output = nullptr; // 确保状态一致
return;
}
auto *raw = get_color_control(output);
if (!raw) {
m_output = nullptr; // 获取失败时重置状态,以便下次重试
return;
}
m_output = output; // 成功获取后再赋值
m_control = new TreelandColorControl(raw, this);
connect(m_control, &TreelandColorControl::brightnessChanged,
this, &TreelandBrightness::brightnessChanged);
} |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, yixinshark 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) |
Summary
Test plan
osdpanelandosd-brightness.