parent
ef2c73af80
commit
b1d0a727cc
1 changed files with 4 additions and 2 deletions
|
|
@ -158,6 +158,7 @@ void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: detect a popup in a more consistent way.
|
// TODO: detect a popup in a more consistent way.
|
||||||
|
bool centeredOnParent = false;
|
||||||
if ((desiredGeometry.x == 0 && desiredGeometry.y == 0) || !visible || !pWindow->m_isX11) {
|
if ((desiredGeometry.x == 0 && desiredGeometry.y == 0) || !visible || !pWindow->m_isX11) {
|
||||||
// if the pos isn't set, fall back to the center placement if it's not a child
|
// if the pos isn't set, fall back to the center placement if it's not a child
|
||||||
auto pos = PMONITOR->m_position + PMONITOR->m_size / 2.F - desiredGeometry.size() / 2.F;
|
auto pos = PMONITOR->m_position + PMONITOR->m_size / 2.F - desiredGeometry.size() / 2.F;
|
||||||
|
|
@ -168,10 +169,11 @@ void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) {
|
||||||
*pWindow->m_realPosition = PARENT->m_realPosition->goal() + PARENT->m_realSize->goal() / 2.F - desiredGeometry.size() / 2.F;
|
*pWindow->m_realPosition = PARENT->m_realPosition->goal() + PARENT->m_realSize->goal() / 2.F - desiredGeometry.size() / 2.F;
|
||||||
pWindow->m_workspace = PARENT->m_workspace;
|
pWindow->m_workspace = PARENT->m_workspace;
|
||||||
pWindow->m_monitor = PARENT->m_monitor;
|
pWindow->m_monitor = PARENT->m_monitor;
|
||||||
|
centeredOnParent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!centeredOnParent)
|
||||||
*pWindow->m_realPosition = pos;
|
*pWindow->m_realPosition = pos;
|
||||||
} else {
|
} else {
|
||||||
// if it is, we respect where it wants to put itself, but apply monitor offset if outside
|
// if it is, we respect where it wants to put itself, but apply monitor offset if outside
|
||||||
// most of these are popups
|
// most of these are popups
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue