mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 06:18:05 +02:00
input: restrict border resizing logic to floating windows and multi-windows
This commit is contained in:
parent
450d8a0bf7
commit
eafb60e5ac
1 changed files with 10 additions and 6 deletions
|
|
@ -595,7 +595,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st
|
|||
if (pFoundWindow) {
|
||||
// change cursor icon if hovering over border
|
||||
if (*PRESIZEONBORDER && *PRESIZECURSORICON) {
|
||||
if (!pFoundWindow->isFullscreen() && !pFoundWindow->hasPopupAt(mouseCoords))
|
||||
if (!pFoundWindow->isFullscreen() && !pFoundWindow->hasPopupAt(mouseCoords) && PWORKSPACE->getWindows() > 1 &&
|
||||
(pFoundWindow->m_isFloating || PWORKSPACE->getWindows(false) == 0))
|
||||
setCursorIconOnBorder(pFoundWindow);
|
||||
else if (m_borderIconDirection != BORDERICON_NONE) {
|
||||
m_borderIconDirection = BORDERICON_NONE;
|
||||
|
|
@ -807,12 +808,15 @@ void CInputManager::processMouseDownNormal(const IPointer::SButtonEvent& e, SP<I
|
|||
// TODO detect click on LS properly
|
||||
if (*PRESIZEONBORDER && !g_pSessionLockManager->isSessionLocked() && !m_lastFocusOnLS && e.state == WL_POINTER_BUTTON_STATE_PRESSED && (!w || !w->isX11OverrideRedirect())) {
|
||||
if (w && !w->isFullscreen()) {
|
||||
const CBox real = {w->m_realPosition->value().x, w->m_realPosition->value().y, w->m_realSize->value().x, w->m_realSize->value().y};
|
||||
const CBox grab = {real.x - BORDER_GRAB_AREA, real.y - BORDER_GRAB_AREA, real.width + 2 * BORDER_GRAB_AREA, real.height + 2 * BORDER_GRAB_AREA};
|
||||
const auto PWORKSPACE = w->m_workspace;
|
||||
if (PWORKSPACE && PWORKSPACE->getWindows() > 1 && (w->m_isFloating || PWORKSPACE->getWindows(false) == 0)) {
|
||||
const CBox real = {w->m_realPosition->value().x, w->m_realPosition->value().y, w->m_realSize->value().x, w->m_realSize->value().y};
|
||||
const CBox grab = {real.x - BORDER_GRAB_AREA, real.y - BORDER_GRAB_AREA, real.width + 2 * BORDER_GRAB_AREA, real.height + 2 * BORDER_GRAB_AREA};
|
||||
|
||||
if ((grab.containsPoint(mouseCoords) && (!real.containsPoint(mouseCoords) || w->isInCurvedCorner(mouseCoords.x, mouseCoords.y))) && !w->hasPopupAt(mouseCoords)) {
|
||||
g_pKeybindManager->resizeWithBorder(e);
|
||||
return;
|
||||
if ((grab.containsPoint(mouseCoords) && (!real.containsPoint(mouseCoords) || w->isInCurvedCorner(mouseCoords.x, mouseCoords.y))) && !w->hasPopupAt(mouseCoords)) {
|
||||
g_pKeybindManager->resizeWithBorder(e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue