From c44c79abb269da36b68d0524f45aa4c0b92dedca Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 30 May 2022 17:11:35 +0200 Subject: fix monitor cleanups on removed --- src/Compositor.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/Compositor.cpp') diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 0b60369d..4239c7bf 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -936,4 +936,21 @@ void CCompositor::updateWindowBorderColor(CWindow* pWindow) { pWindow->m_cRealBorderColor = RENDERDATA.borderColor; else pWindow->m_cRealBorderColor = CColor(pWindow == m_pLastWindow ? *ACTIVECOL : *INACTIVECOL); -} \ No newline at end of file +} + +void CCompositor::moveWindowToWorkspace(CWindow* pWindow, const std::string& work) { + m_pLastWindow = pWindow; + g_pKeybindManager->moveActiveToWorkspace(work); + + g_pInputManager->refocus(); +} + +int CCompositor::getNextAvailableMonitorID() { + int64_t topID = -1; + for (auto& m : m_lMonitors) { + if ((int64_t)m.ID > topID) + topID = m.ID; + } + + return topID + 1; +} -- cgit v1.2.3