mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
gamma: recreate controls on resume
This commit is contained in:
@@ -878,18 +878,35 @@ func (m *Manager) handleDBusSignal(sig *dbus.Signal) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
preparing, ok := sig.Body[0].(bool)
|
preparing, ok := sig.Body[0].(bool)
|
||||||
if !ok {
|
if !ok || preparing {
|
||||||
return
|
|
||||||
}
|
|
||||||
if preparing {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.configMutex.RLock()
|
m.configMutex.RLock()
|
||||||
enabled := m.config.Enabled
|
enabled := m.config.Enabled
|
||||||
m.configMutex.RUnlock()
|
m.configMutex.RUnlock()
|
||||||
if enabled {
|
if !enabled {
|
||||||
m.triggerUpdate()
|
return
|
||||||
}
|
}
|
||||||
|
time.AfterFunc(500*time.Millisecond, func() {
|
||||||
|
m.post(func() {
|
||||||
|
m.configMutex.RLock()
|
||||||
|
stillEnabled := m.config.Enabled
|
||||||
|
m.configMutex.RUnlock()
|
||||||
|
if !stillEnabled || !m.controlsInitialized {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
m.outputs.Range(func(_ uint32, out *outputState) bool {
|
||||||
|
if out.gammaControl != nil {
|
||||||
|
out.gammaControl.(*wlr_gamma_control.ZwlrGammaControlV1).Destroy()
|
||||||
|
out.gammaControl = nil
|
||||||
|
}
|
||||||
|
out.retryCount = 0
|
||||||
|
out.failed = false
|
||||||
|
m.recreateOutputControl(out)
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) triggerUpdate() {
|
func (m *Manager) triggerUpdate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user