mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
core/extworkspace: only register outputs on name received
This commit is contained in:
@@ -75,6 +75,9 @@ func (m *Manager) setupRegistry() error {
|
|||||||
output.SetNameHandler(func(ev wlclient.OutputNameEvent) {
|
output.SetNameHandler(func(ev wlclient.OutputNameEvent) {
|
||||||
m.outputNames.Store(outputID, ev.Name)
|
m.outputNames.Store(outputID, ev.Name)
|
||||||
log.Debugf("ExtWorkspace: Output %d (%s) name received", outputID, ev.Name)
|
log.Debugf("ExtWorkspace: Output %d (%s) name received", outputID, ev.Name)
|
||||||
|
m.post(func() {
|
||||||
|
m.updateState()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@@ -295,14 +298,8 @@ func (m *Manager) updateState() {
|
|||||||
|
|
||||||
outputs := make([]string, 0)
|
outputs := make([]string, 0)
|
||||||
for outputID := range group.outputIDs {
|
for outputID := range group.outputIDs {
|
||||||
if name, ok := m.outputNames.Load(outputID); ok {
|
if name, ok := m.outputNames.Load(outputID); ok && name != "" {
|
||||||
if name != "" {
|
outputs = append(outputs, name)
|
||||||
outputs = append(outputs, name)
|
|
||||||
} else {
|
|
||||||
outputs = append(outputs, fmt.Sprintf("output-%d", outputID))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
outputs = append(outputs, fmt.Sprintf("output-%d", outputID))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user