mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 13:25:58 +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)
|
||||
bool visible = pWindow->m_bIsX11;
|
||||
|
||||
if (!pWindow->m_bIsX11) {
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
if (VECINRECT(Vector2D(desiredGeometry.x, desiredGeometry.y), 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), m->vecPosition.x, m->vecPosition.y, m->vecPosition.x + m->vecSize.x,
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (!visible) {
|
||||
visible = g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x, desiredGeometry.y)) &&
|
||||
g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x + desiredGeometry.width, desiredGeometry.y)) &&
|
||||
g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x, desiredGeometry.y + desiredGeometry.height)) &&
|
||||
g_pCompositor->isPointOnAnyMonitor(Vector2D(desiredGeometry.x + desiredGeometry.width, desiredGeometry.y + desiredGeometry.height));
|
||||
}
|
||||
|
||||
// TODO: detect a popup in a more consistent way.
|
||||
|
|
Loading…
Reference in a new issue