Skip to content

Commit

Permalink
master: partially revert 0e64dd2 and fix the animation (#3327)
Browse files Browse the repository at this point in the history
  • Loading branch information
thejch authored Sep 15, 2023
1 parent b9b3842 commit cc630c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/layout/MasterLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
g_pXWaylandManager->setWindowSize(PWINDOW, calcSize);
}

if (!*PANIMATE) {
if (m_bForceWarps && !*PANIMATE) {
g_pHyprRenderer->damageWindow(PWINDOW);

PWINDOW->m_vRealPosition.warp();
Expand Down Expand Up @@ -691,6 +691,8 @@ void CHyprMasterLayout::resizeActiveWindow(const Vector2D& pixResize, eRectCorne
if (getNodesOnWorkspace(PWINDOW->m_iWorkspaceID) == 1 && !centered)
return;

m_bForceWarps = true;

switch (orientation) {
case ORIENTATION_LEFT: delta = pixResize.x / PMONITOR->vecSize.x; break;
case ORIENTATION_RIGHT: delta = -pixResize.x / PMONITOR->vecSize.x; break;
Expand Down Expand Up @@ -788,6 +790,8 @@ void CHyprMasterLayout::resizeActiveWindow(const Vector2D& pixResize, eRectCorne
}

recalculateMonitor(PMONITOR->ID);

m_bForceWarps = false;
}

void CHyprMasterLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreenMode fullscreenMode, bool on) {
Expand Down
2 changes: 2 additions & 0 deletions src/layout/MasterLayout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ class CHyprMasterLayout : public IHyprLayout {
std::list<SMasterNodeData> m_lMasterNodesData;
std::vector<SMasterWorkspaceData> m_lMasterWorkspacesData;

bool m_bForceWarps = false;

void buildOrientationCycleVectorFromVars(std::vector<eOrientation>& cycle, CVarList& vars);
void buildOrientationCycleVectorFromEOperation(std::vector<eOrientation>& cycle);
void runOrientationCycle(SLayoutMessageHeader& header, CVarList* vars, int next);
Expand Down

0 comments on commit cc630c9

Please sign in to comment.