diff options
| author | dranull <150595692+dranull@users.noreply.github.com> | 2023-12-28 22:54:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-28 23:54:41 +0100 |
| commit | 8321d6be46ed2df7dfe7ec142716a7d1a50d2d5e (patch) | |
| tree | 8381a98e72b0ae839847da7ac7a122027317b6bf /src/layout | |
| parent | cedf5f1fca057351d85560ff72bf2cc6cc609755 (diff) | |
internal: Unify input handling on decorations (#4280)
* Unify input handling on decorations
* Make input methods private
* Optional data
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/DwindleLayout.cpp | 12 | ||||
| -rw-r--r-- | src/layout/IHyprLayout.cpp | 12 | ||||
| -rw-r--r-- | src/layout/MasterLayout.cpp | 12 |
3 files changed, 6 insertions, 30 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 63c2fec2..53ddb86e 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -316,16 +316,8 @@ void CHyprDwindleLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection dire } if (!m_vOverrideFocalPoint && g_pInputManager->m_bWasDraggingWindow) { - for (auto& wd : OPENINGON->pWindow->m_dWindowDecorations) { - if (!(wd->getDecorationFlags() & DECORATION_ALLOWS_MOUSE_INPUT)) - continue; - - if (g_pDecorationPositioner->getWindowDecorationBox(wd.get()).containsPoint(MOUSECOORDS)) { - if (!wd->onEndWindowDragOnDeco(pWindow, MOUSECOORDS)) - return; - break; - } - } + if (OPENINGON->pWindow->checkInputOnDecos(INPUT_TYPE_DRAG_END, MOUSECOORDS, pWindow)) + return; } // if it's a group, add the window diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 0c6d24fd..76f1e796 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -271,16 +271,8 @@ void IHyprLayout::onEndDragWindow() { CWindow* pWindow = g_pCompositor->vectorToWindowIdeal(MOUSECOORDS, DRAGGINGWINDOW); if (pWindow && pWindow->m_bIsFloating) { - for (auto& wd : pWindow->m_dWindowDecorations) { - if (!(wd->getDecorationFlags() & DECORATION_ALLOWS_MOUSE_INPUT)) - continue; - - if (g_pDecorationPositioner->getWindowDecorationBox(wd.get()).containsPoint(MOUSECOORDS)) { - if (!wd->onEndWindowDragOnDeco(DRAGGINGWINDOW, MOUSECOORDS)) - return; - break; - } - } + if (pWindow->checkInputOnDecos(INPUT_TYPE_DRAG_END, MOUSECOORDS, DRAGGINGWINDOW)) + return; if (pWindow->m_sGroupData.pNextWindow && DRAGGINGWINDOW->canBeGroupedInto(pWindow)) { static const auto* USECURRPOS = &g_pConfigManager->getConfigValuePtr("group:insert_after_current")->intValue; diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index def03236..65f85691 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -102,16 +102,8 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow, eDirection direc const auto MOUSECOORDS = g_pInputManager->getMouseCoordsInternal(); if (g_pInputManager->m_bWasDraggingWindow && OPENINGON) { - for (auto& wd : OPENINGON->pWindow->m_dWindowDecorations) { - if (!(wd->getDecorationFlags() & DECORATION_ALLOWS_MOUSE_INPUT)) - continue; - - if (g_pDecorationPositioner->getWindowDecorationBox(wd.get()).containsPoint(MOUSECOORDS)) { - if (!wd->onEndWindowDragOnDeco(pWindow, MOUSECOORDS)) - return; - break; - } - } + if (OPENINGON->pWindow->checkInputOnDecos(INPUT_TYPE_DRAG_END, MOUSECOORDS, pWindow)) + return; } // if it's a group, add the window |
