1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04:00

fix(brightness): refresh sysfs cache on hotplug (#1674)

* fix(brightness): refresh sysfs cache on hotplug

The SysfsBackend used a cache that was never refreshed on display hot plug, causing new backlight devices to not appear in IPC until restart.

This adds Rescan() to SysfsBackend and calls it in Manager.Rescan(), matching the behavior of DDCBackend.

Fixes: hotplugged external monitor brightness control via IPC

* make fmt

---------

Co-authored-by: bbedward <bbedward@gmail.com>
This commit is contained in:
Artem
2026-02-14 20:00:01 +01:00
committed by GitHub
parent 52d5af11ba
commit 24e3024b57
2 changed files with 10 additions and 0 deletions

View File

@@ -96,6 +96,12 @@ func (m *Manager) Rescan() {
}
}
if m.sysfsReady && m.sysfsBackend != nil {
if err := m.sysfsBackend.Rescan(); err != nil {
log.Debugf("Sysfs rescan failed: %v", err)
}
}
m.updateState()
}

View File

@@ -101,6 +101,10 @@ func shouldSuppressDevice(name string) bool {
return false
}
func (b *SysfsBackend) Rescan() error {
return b.scanDevices()
}
func (b *SysfsBackend) GetDevices() ([]Device, error) {
devices := make([]Device, 0)