mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-23 14:29:48 +01:00
input: let input-grabbing decos have prio over resize on border
This commit is contained in:
parent
59d6a12a7e
commit
86318ce04f
1 changed files with 58 additions and 37 deletions
|
@ -1621,14 +1621,33 @@ void CInputManager::setCursorIconOnBorder(CWindow* w) {
|
||||||
// give a small leeway (10 px) for corner icon
|
// give a small leeway (10 px) for corner icon
|
||||||
const auto CORNER = *PROUNDING + BORDERSIZE + 10;
|
const auto CORNER = *PROUNDING + BORDERSIZE + 10;
|
||||||
const auto mouseCoords = getMouseCoordsInternal();
|
const auto mouseCoords = getMouseCoordsInternal();
|
||||||
wlr_box box = {w->m_vRealPosition.vec().x, w->m_vRealPosition.vec().y, w->m_vRealSize.vec().x, w->m_vRealSize.vec().y};
|
wlr_box box = w->getWindowMainSurfaceBox();
|
||||||
eBorderIconDirection direction = BORDERICON_NONE;
|
eBorderIconDirection direction = BORDERICON_NONE;
|
||||||
wlr_box boxFullGrabInput = {box.x - *PEXTENDBORDERGRAB - BORDERSIZE, box.y - *PEXTENDBORDERGRAB - BORDERSIZE, box.width + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE),
|
wlr_box boxFullGrabInput = {box.x - *PEXTENDBORDERGRAB - BORDERSIZE, box.y - *PEXTENDBORDERGRAB - BORDERSIZE, box.width + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE),
|
||||||
box.height + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE)};
|
box.height + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE)};
|
||||||
|
|
||||||
if (!wlr_box_contains_point(&boxFullGrabInput, mouseCoords.x, mouseCoords.y) || (!m_lCurrentlyHeldButtons.empty() && !currentlyDraggedWindow)) {
|
if (w->hasPopupAt(mouseCoords))
|
||||||
direction = BORDERICON_NONE;
|
direction = BORDERICON_NONE;
|
||||||
} else if (wlr_box_contains_point(&box, mouseCoords.x, mouseCoords.y)) {
|
else if (!wlr_box_contains_point(&boxFullGrabInput, mouseCoords.x, mouseCoords.y) || (!m_lCurrentlyHeldButtons.empty() && !currentlyDraggedWindow))
|
||||||
|
direction = BORDERICON_NONE;
|
||||||
|
else {
|
||||||
|
|
||||||
|
bool onDeco = false;
|
||||||
|
|
||||||
|
for (auto& d : w->m_dWindowDecorations) {
|
||||||
|
if (!d->allowsInput())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (d->getWindowDecorationRegion().containsPoint(mouseCoords)) {
|
||||||
|
onDeco = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (onDeco)
|
||||||
|
direction = BORDERICON_NONE;
|
||||||
|
else {
|
||||||
|
if (wlr_box_contains_point(&box, mouseCoords.x, mouseCoords.y)) {
|
||||||
if (!w->isInCurvedCorner(mouseCoords.x, mouseCoords.y)) {
|
if (!w->isInCurvedCorner(mouseCoords.x, mouseCoords.y)) {
|
||||||
direction = BORDERICON_NONE;
|
direction = BORDERICON_NONE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1666,6 +1685,8 @@ void CInputManager::setCursorIconOnBorder(CWindow* w) {
|
||||||
direction = BORDERICON_RIGHT;
|
direction = BORDERICON_RIGHT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (direction == m_eBorderIconDirection)
|
if (direction == m_eBorderIconDirection)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue