mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2026-01-03 22:00:09 +01:00
hyprscrolling: fixed moveWindowTo behavior (#546)
* fixed incorrect index * fixed broken conditional * undoing idxForHeight change
This commit is contained in:
parent
57961d69ad
commit
7ffc0b314e
2 changed files with 6 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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<SScrollingWindowData> w);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue