forked from Shinonome/dots-hyprland
fix(brightness): prevent bus number collision for identical monitor models
This commit is contained in:
@@ -74,8 +74,14 @@ Singleton {
|
|||||||
id: monitor
|
id: monitor
|
||||||
|
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
readonly property bool isDdc: root.ddcMonitors.some(m => m.model === screen.model)
|
readonly property bool isDdc: {
|
||||||
readonly property string busNum: root.ddcMonitors.find(m => m.model === screen.model)?.busNum ?? ""
|
const match = root.ddcMonitors.find(m => m.model === screen.model && !root.monitors.slice(0, root.monitors.indexOf(this)).some(mon => mon.busNum === m.busNum));
|
||||||
|
return !!match;
|
||||||
|
}
|
||||||
|
readonly property string busNum: {
|
||||||
|
const match = root.ddcMonitors.find(m => m.model === screen.model && !root.monitors.slice(0, root.monitors.indexOf(this)).some(mon => mon.busNum === m.busNum));
|
||||||
|
return match?.busNum ?? "";
|
||||||
|
}
|
||||||
property int rawMaxBrightness: 100
|
property int rawMaxBrightness: 100
|
||||||
property real brightness
|
property real brightness
|
||||||
property bool ready: false
|
property bool ready: false
|
||||||
|
|||||||
Reference in New Issue
Block a user