diff --git a/hyprscrolling/Scrolling.cpp b/hyprscrolling/Scrolling.cpp index 47db478..9d9fff6 100644 --- a/hyprscrolling/Scrolling.cpp +++ b/hyprscrolling/Scrolling.cpp @@ -1445,8 +1445,8 @@ void CScrollingLayout::moveWindowTo(PHLWINDOW w, const std::string& dir, bool si NEWCOL->add(DATA); WS->centerOrFitCol(NEWCOL); } else { - if (COL->windowDatas.size() > 1 || DATA->column) - COL->add(DATA, COL->idxForHeight(g_pInputManager->getMouseCoordsInternal().y) - 1); + if (COL->windowDatas.size() > 0) + COL->add(DATA, COL->idxForHeight(g_pInputManager->getMouseCoordsInternal().y)); else COL->add(DATA); WS->centerOrFitCol(COL); @@ -1462,8 +1462,8 @@ void CScrollingLayout::moveWindowTo(PHLWINDOW w, const std::string& dir, bool si NEWCOL->add(DATA); WS->centerOrFitCol(NEWCOL); } else { - if (COL->windowDatas.size() > 1 || DATA->column) - COL->add(DATA, COL->idxForHeight(g_pInputManager->getMouseCoordsInternal().y) - 1); + if (COL->windowDatas.size() > 0) + COL->add(DATA, COL->idxForHeight(g_pInputManager->getMouseCoordsInternal().y)); else COL->add(DATA); WS->centerOrFitCol(COL); diff --git a/hyprscrolling/Scrolling.hpp b/hyprscrolling/Scrolling.hpp index 21b5dbc..3538548 100644 --- a/hyprscrolling/Scrolling.hpp +++ b/hyprscrolling/Scrolling.hpp @@ -35,6 +35,8 @@ struct SColumnData { void remove(PHLWINDOW w); bool has(PHLWINDOW w); size_t idx(PHLWINDOW w); + + // index of lowest window that is above y. size_t idxForHeight(float y); void up(SP w);