summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-12 11:27:31 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-12 11:27:31 +0200
commitff0f535c28018eeb5164f3576904748b73136202 (patch)
tree0180a5d51034754efe36c6bc352eb198aca4827c /src/managers/KeybindManager.cpp
parent07e208aa73a69505264e8a2922699e09ad708d58 (diff)
Added workspace animations
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp15
1 files changed, 15 insertions, 0 deletions
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());