From ff0f535c28018eeb5164f3576904748b73136202 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Thu, 12 May 2022 11:27:31 +0200 Subject: Added workspace animations --- src/managers/KeybindManager.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/managers/KeybindManager.cpp') diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 900e1e00..3a354f23 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -202,6 +202,14 @@ void CKeybindManager::changeworkspace(std::string args) { // and fix on the new workspace g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); + + // here and only here begin anim. we don't want to anim visible workspaces on other monitors. + // start anim on old workspace + g_pCompositor->getWorkspaceByID(OLDWORKSPACEID)->m_vRenderOffset = Vector2D(-PMONITOR->vecSize.x, 0); + + // start anim on new workspace + g_pCompositor->getWorkspaceByID(workspaceToChangeTo)->m_vRenderOffset.setValueAndWarp(Vector2D(PMONITOR->vecSize.x, 0)); + g_pCompositor->getWorkspaceByID(workspaceToChangeTo)->m_vRenderOffset = Vector2D(0, 0); } @@ -234,9 +242,16 @@ void CKeybindManager::changeworkspace(std::string args) { const auto OLDWORKSPACE = PMONITOR->activeWorkspace; + // start anim on old workspace + g_pCompositor->getWorkspaceByID(OLDWORKSPACE)->m_vRenderOffset = Vector2D(-PMONITOR->vecSize.x, 0); + g_pCompositor->m_lWorkspaces.emplace_back(PMONITOR->ID); const auto PWORKSPACE = &g_pCompositor->m_lWorkspaces.back(); + // start anim on new workspace + PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(PMONITOR->vecSize.x, 0)); + PWORKSPACE->m_vRenderOffset = Vector2D(0, 0); + // We are required to set the name here immediately wlr_ext_workspace_handle_v1_set_name(PWORKSPACE->m_pWlrHandle, workspaceName.c_str()); -- cgit v1.2.3