mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 11:05:58 +01:00
Fix opening floating on another mon
This commit is contained in:
parent
6bfe9162e1
commit
908901fbda
1 changed files with 7 additions and 2 deletions
|
@ -556,11 +556,16 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) {
|
|||
// if it's not, fall back to the center placement
|
||||
pWindow->m_vRealPosition = PMONITOR->vecPosition + Vector2D((PMONITOR->vecSize.x - desiredGeometry.width) / 2.f, (PMONITOR->vecSize.y - desiredGeometry.height) / 2.f);
|
||||
} else {
|
||||
// if it is, we respect where it wants to put itself.
|
||||
// if it is, we respect where it wants to put itself, but apply monitor offset if outside
|
||||
// most of these are popups
|
||||
|
||||
if (const auto POPENMON = g_pCompositor->getMonitorFromVector(middlePoint); POPENMON->ID != PMONITOR->ID) {
|
||||
pWindow->m_vRealPosition = Vector2D(desiredGeometry.x, desiredGeometry.y) - POPENMON->vecPosition + PMONITOR->vecPosition;
|
||||
} else {
|
||||
pWindow->m_vRealPosition = Vector2D(desiredGeometry.x, desiredGeometry.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!pWindow->m_bX11DoesntWantBorders) {
|
||||
pWindow->m_vRealPosition.setValue(pWindow->m_vRealPosition.goalv() + pWindow->m_vRealSize.goalv() / 2.f);
|
||||
|
|
Loading…
Reference in a new issue