diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-11 19:51:37 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-04-11 19:51:37 +0200 |
| commit | a8e872923045eddd314bc26553401a6eb17c57cc (patch) | |
| tree | e8fa6a207b485cebd78f752e7683452000f0be48 /src/managers/InputManager.cpp | |
| parent | b56343133d21622a6187bb1ef8906023ecbc09ef (diff) | |
Added zext_workspace protocol support 🎉
Diffstat (limited to 'src/managers/InputManager.cpp')
| -rw-r--r-- | src/managers/InputManager.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/managers/InputManager.cpp b/src/managers/InputManager.cpp index 5157a063..93f842a4 100644 --- a/src/managers/InputManager.cpp +++ b/src/managers/InputManager.cpp @@ -27,17 +27,28 @@ void CInputManager::mouseMoveUnified(uint32_t time) { Vector2D mouseCoords = getMouseCoordsInternal(); const auto PMONITOR = g_pCompositor->getMonitorFromCursor(); - if (PMONITOR) + if (PMONITOR && PMONITOR != g_pCompositor->m_pLastMonitor) { + // update wlr workspaces when this happens + if (g_pCompositor->m_pLastMonitor) + wlr_ext_workspace_group_handle_v1_output_leave(g_pCompositor->m_pLastMonitor->pWLRWorkspaceGroupHandle, g_pCompositor->m_pLastMonitor->output); + g_pCompositor->m_pLastMonitor = PMONITOR; + wlr_ext_workspace_group_handle_v1_output_enter(PMONITOR->pWLRWorkspaceGroupHandle, PMONITOR->output); + + // set active workspace and deactivate all other in wlr + g_pCompositor->deactivateAllWLRWorkspaces(); + wlr_ext_workspace_handle_v1_set_active(g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace)->m_pWlrHandle, true); + } + Vector2D surfaceCoords; Vector2D surfacePos = Vector2D(-1337, -1337); CWindow* pFoundWindow = nullptr; // first, we check if the workspace doesnt have a fullscreen window const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace); - if (PWORKSPACE->hasFullscreenWindow) { - pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->ID); + if (PWORKSPACE->m_bHasFullscreenWindow) { + pFoundWindow = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); for (auto w = g_pCompositor->m_lWindows.rbegin(); w != g_pCompositor->m_lWindows.rend(); ++w) { wlr_box box = {w->m_vRealPosition.x, w->m_vRealPosition.y, w->m_vRealSize.x, w->m_vRealSize.y}; |
