monitors: fix some bugs with re-plug

This commit is contained in:
vaxerski
2023-05-06 16:49:46 +01:00
parent 7e5ba5e824
commit afe8d8dfec
2 changed files with 15 additions and 9 deletions

View File

@@ -145,7 +145,7 @@ void CMonitor::onConnect(bool noRule) {
setupDefaultWS(monitorRule);
for (auto& ws : g_pCompositor->m_vWorkspaces) {
if (ws->m_szLastMonitor == szName) {
if (ws->m_szLastMonitor == szName || g_pCompositor->m_vMonitors.size() == 1 /* avoid lost workspaces on recover */) {
g_pCompositor->moveWorkspaceToMonitor(ws.get(), this);
ws->startAnim(true, true, true);
ws->m_szLastMonitor = "";