diff options
author | Vaxry <[email protected]> | 2024-03-02 21:04:55 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-02 21:04:55 +0000 |
commit | d72ea5f2a7fdb0d0a7bf914412327195b05199b0 (patch) | |
tree | 0ebc3bb4c8320e88cfa9010d314122c9533dcc0e /src/helpers/WLClasses.cpp | |
parent | 328ab431655f207a5ee59737291f8e8d85fab992 (diff) | |
download | Hyprland-d72ea5f2a7fdb0d0a7bf914412327195b05199b0.tar.gz Hyprland-d72ea5f2a7fdb0d0a7bf914412327195b05199b0.zip |
input: Rewritten pointer constraints (#4889)
* rewritten constraints
* send pointer enter on activate if not pointer focus
* minor cleanup
* simulate movement on commit
* don't ignore oneshot prop
* various fixes
* dont send motion on confined
* update pos hint on region change
Diffstat (limited to 'src/helpers/WLClasses.cpp')
-rw-r--r-- | src/helpers/WLClasses.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/helpers/WLClasses.cpp b/src/helpers/WLClasses.cpp index 3cf170bf..8964ba59 100644 --- a/src/helpers/WLClasses.cpp +++ b/src/helpers/WLClasses.cpp @@ -167,82 +167,6 @@ bool SLayerSurface::isFadedOut() { return !realPosition.isBeingAnimated() && !realSize.isBeingAnimated() && !alpha.isBeingAnimated(); } -CRegion SConstraint::getLogicCoordsRegion() { - CRegion result; - - if (!constraint) - return result; - - const auto PWINDOWOWNER = g_pCompositor->getWindowFromSurface(constraint->surface); - - if (!PWINDOWOWNER) - return result; - - result.add(&constraint->region); // surface-local coords - - if (!PWINDOWOWNER->m_bIsX11) { - result.translate(PWINDOWOWNER->m_vRealPosition.goal()); - return result; - } - - const auto COORDS = PWINDOWOWNER->m_bIsMapped ? PWINDOWOWNER->m_vRealPosition.goal() : - g_pXWaylandManager->xwaylandToWaylandCoords({PWINDOWOWNER->m_uSurface.xwayland->x, PWINDOWOWNER->m_uSurface.xwayland->y}); - - const auto PMONITOR = PWINDOWOWNER->m_bIsMapped ? g_pCompositor->getMonitorFromID(PWINDOWOWNER->m_iMonitorID) : g_pCompositor->getMonitorFromVector(COORDS); - - if (!PMONITOR) - return CRegion{}; - - result.scale(PMONITOR->xwaylandScale); - - result.translate(COORDS); - - return result; -} - -Vector2D SConstraint::getLogicConstraintPos() { - if (!constraint) - return {}; - - const auto PWINDOWOWNER = g_pCompositor->getWindowFromSurface(constraint->surface); - - if (!PWINDOWOWNER) - return {}; - - if (!PWINDOWOWNER->m_bIsX11) - return PWINDOWOWNER->m_vRealPosition.goal(); - - const auto COORDS = PWINDOWOWNER->m_bIsMapped ? PWINDOWOWNER->m_vRealPosition.goal() : - g_pXWaylandManager->xwaylandToWaylandCoords({PWINDOWOWNER->m_uSurface.xwayland->x, PWINDOWOWNER->m_uSurface.xwayland->y}); - - return COORDS; -} - -Vector2D SConstraint::getLogicConstraintSize() { - if (!constraint) - return {}; - - const auto PWINDOWOWNER = g_pCompositor->getWindowFromSurface(constraint->surface); - - if (!PWINDOWOWNER) - return {}; - - if (!PWINDOWOWNER->m_bIsX11) - return PWINDOWOWNER->m_vRealSize.goal(); - - const auto PMONITOR = PWINDOWOWNER->m_bIsMapped ? - g_pCompositor->getMonitorFromID(PWINDOWOWNER->m_iMonitorID) : - g_pCompositor->getMonitorFromVector(g_pXWaylandManager->xwaylandToWaylandCoords({PWINDOWOWNER->m_uSurface.xwayland->x, PWINDOWOWNER->m_uSurface.xwayland->y})); - - if (!PMONITOR) - return {}; - - const auto SIZE = PWINDOWOWNER->m_bIsMapped ? PWINDOWOWNER->m_vRealSize.goal() : - Vector2D{PWINDOWOWNER->m_uSurface.xwayland->width, PWINDOWOWNER->m_uSurface.xwayland->height} * PMONITOR->xwaylandScale; - - return SIZE; -} - void SKeyboard::updateXKBTranslationState(xkb_keymap* const keymap) { xkb_state_unref(xkbTranslationState); |