summaryrefslogtreecommitdiff
path: root/src/events/Monitors.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-30 20:45:39 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-30 20:45:39 +0200
commitb2474d406a98b2d271107842074614975a469237 (patch)
tree5770604e93823bd86a87e2bd69a3451e20b86f24 /src/events/Monitors.cpp
parenteee9698ec90daee9e6f8e3b4f4b242f38287ff81 (diff)
don't duplicate workspaces on connect
Diffstat (limited to 'src/events/Monitors.cpp')
-rw-r--r--src/events/Monitors.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/events/Monitors.cpp b/src/events/Monitors.cpp
index 4487bf2f..64f6e56a 100644
--- a/src/events/Monitors.cpp
+++ b/src/events/Monitors.cpp
@@ -110,7 +110,7 @@ void Events::listener_newOutput(wl_listener* listener, void* data) {
wlr_ext_workspace_group_handle_v1_output_enter(PNEWMONITOR->pWLRWorkspaceGroupHandle, PNEWMONITOR->output);
// Workspace
- const auto WORKSPACEID = monitorRule.defaultWorkspaceID == -1 ? g_pCompositor->m_lWorkspaces.size() + 1 /* Cuz workspaces doesnt have the new one yet and we start with 1 */ : monitorRule.defaultWorkspaceID;
+ const auto WORKSPACEID = monitorRule.defaultWorkspaceID == -1 && !g_pCompositor->getWorkspaceByID(monitorRule.defaultWorkspaceID) ? g_pCompositor->m_lWorkspaces.size() + 1 /* Cuz workspaces doesnt have the new one yet and we start with 1 */ : monitorRule.defaultWorkspaceID;
g_pCompositor->m_lWorkspaces.emplace_back(newMonitor.ID);
const auto PNEWWORKSPACE = &g_pCompositor->m_lWorkspaces.back();