mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 04:49:48 +01:00
layout: use full box for visibility check of floating xdg
Fixes #3069, if an xdg dialog pops up and is partially off bounds, just move it to the center.
This commit is contained in:
parent
870471dd96
commit
9dae8ece71
1 changed files with 5 additions and 15 deletions
|
@ -129,21 +129,11 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) {
|
||||||
// check if it's visible on any monitor (only for XDG)
|
// check if it's visible on any monitor (only for XDG)
|
||||||
bool visible = pWindow->m_bIsX11;
|
bool visible = pWindow->m_bIsX11;
|
||||||
|
|
||||||
if (!pWindow->m_bIsX11) {
|
if (!visible) {
|
||||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
visible = g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x, desiredGeometry.y)) &&
|
||||||
if (VECINRECT(Vector2D(desiredGeometry.x, desiredGeometry.y), m->vecPosition.x, m->vecPosition.y, m->vecPosition.x + m->vecSize.x,
|
g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x + desiredGeometry.width, desiredGeometry.y)) &&
|
||||||
m->vecPosition.y + m->vecPosition.y) ||
|
g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x, desiredGeometry.y + desiredGeometry.height)) &&
|
||||||
VECINRECT(Vector2D(desiredGeometry.x + desiredGeometry.width, desiredGeometry.y), m->vecPosition.x, m->vecPosition.y, m->vecPosition.x + m->vecSize.x,
|
g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x + desiredGeometry.width, desiredGeometry.y + desiredGeometry.height));
|
||||||
m->vecPosition.y + m->vecPosition.y) ||
|
|
||||||
VECINRECT(Vector2D(desiredGeometry.x, desiredGeometry.y + desiredGeometry.height), m->vecPosition.x, m->vecPosition.y, m->vecPosition.x + m->vecSize.x,
|
|
||||||
m->vecPosition.y + m->vecPosition.y) ||
|
|
||||||
VECINRECT(Vector2D(desiredGeometry.x + desiredGeometry.width, desiredGeometry.y + desiredGeometry.height), m->vecPosition.x, m->vecPosition.y,
|
|
||||||
m->vecPosition.x + m->vecSize.x, m->vecPosition.y + m->vecPosition.y)) {
|
|
||||||
|
|
||||||
visible = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: detect a popup in a more consistent way.
|
// TODO: detect a popup in a more consistent way.
|
||||||
|
|
Loading…
Reference in a new issue