mirror of
https://github.com/hyprwm/Hypr.git
synced 2026-05-09 08:38:03 +02:00
Fixed workspace animation direction
This commit is contained in:
parent
b5a66c165d
commit
404296a173
1 changed files with 36 additions and 15 deletions
|
|
@ -2489,21 +2489,42 @@ void CWindowManager::recalcAllDocks() {
|
|||
void CWindowManager::startWipeAnimOnWorkspace(const int& oldwork, const int& newwork) {
|
||||
const auto PMONITOR = getMonitorFromWorkspace(newwork);
|
||||
|
||||
for (auto& work : workspaces) {
|
||||
if (work.getID() == oldwork) {
|
||||
if (ConfigManager::getInt("animations:workspaces") == 1)
|
||||
work.setCurrentOffset(Vector2D(0,0));
|
||||
else
|
||||
work.setCurrentOffset(Vector2D(150000, 150000));
|
||||
work.setGoalOffset(Vector2D(PMONITOR->vecSize.x, 0));
|
||||
work.setAnimationInProgress(true);
|
||||
} else if (work.getID() == newwork) {
|
||||
if (ConfigManager::getInt("animations:workspaces") == 1)
|
||||
work.setCurrentOffset(Vector2D(-PMONITOR->vecSize.x, 0));
|
||||
else
|
||||
work.setCurrentOffset(Vector2D(0, 0));
|
||||
work.setGoalOffset(Vector2D(0, 0));
|
||||
work.setAnimationInProgress(true);
|
||||
if (newwork < oldwork) { //Swipe from left to right
|
||||
for (auto& work : workspaces) {
|
||||
if (work.getID() == oldwork) {
|
||||
if (ConfigManager::getInt("animations:workspaces") == 1)
|
||||
work.setCurrentOffset(Vector2D(0,0));
|
||||
else
|
||||
work.setCurrentOffset(Vector2D(150000, 150000));
|
||||
work.setGoalOffset(Vector2D(PMONITOR->vecSize.x, 0));
|
||||
work.setAnimationInProgress(true);
|
||||
} else if (work.getID() == newwork) {
|
||||
if (ConfigManager::getInt("animations:workspaces") == 1)
|
||||
work.setCurrentOffset(Vector2D(-PMONITOR->vecSize.x, 0));
|
||||
else
|
||||
work.setCurrentOffset(Vector2D(0, 0));
|
||||
work.setGoalOffset(Vector2D(0, 0));
|
||||
work.setAnimationInProgress(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else { //Swipe from right to left (oldwork < newwork)
|
||||
for (auto& work : workspaces) {
|
||||
if (work.getID() == oldwork) {
|
||||
if (ConfigManager::getInt("animations:workspaces") == 1)
|
||||
work.setCurrentOffset(Vector2D(0,0));
|
||||
else
|
||||
work.setCurrentOffset(Vector2D(150000, 150000));
|
||||
work.setGoalOffset(Vector2D(-PMONITOR->vecSize.x, 0));
|
||||
work.setAnimationInProgress(true);
|
||||
} else if (work.getID() == newwork) {
|
||||
if (ConfigManager::getInt("animations:workspaces") == 1)
|
||||
work.setCurrentOffset(Vector2D(PMONITOR->vecSize.x, 0));
|
||||
else
|
||||
work.setCurrentOffset(Vector2D(0, 0));
|
||||
work.setGoalOffset(Vector2D(0, 0));
|
||||
work.setAnimationInProgress(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue