diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2024-03-02 21:04:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-02 21:04:55 +0000 |
| commit | d72ea5f2a7fdb0d0a7bf914412327195b05199b0 (patch) | |
| tree | 0ebc3bb4c8320e88cfa9010d314122c9533dcc0e /src/managers/input/InputManager.hpp | |
| parent | 328ab431655f207a5ee59737291f8e8d85fab992 (diff) | |
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/managers/input/InputManager.hpp')
| -rw-r--r-- | src/managers/input/InputManager.hpp | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp index e32e27f8..cef8386f 100644 --- a/src/managers/input/InputManager.hpp +++ b/src/managers/input/InputManager.hpp @@ -7,6 +7,8 @@ #include "../../helpers/Timer.hpp" #include "InputMethodRelay.hpp" +class CConstraint; + enum eClickBehaviorMode { CLICKMODE_DEFAULT = 0, CLICKMODE_KILL @@ -80,11 +82,8 @@ class CInputManager { void destroyMouse(wlr_input_device*); void destroySwitch(SSwitchDevice*); - void constrainMouse(SMouse*, wlr_pointer_constraint_v1*); - void warpMouseToConstraintMiddle(SConstraint*); - void recheckConstraint(SMouse*); void unconstrainMouse(); - SConstraint* constraintFromWlr(wlr_pointer_constraint_v1*); + bool isConstrained(); std::string getActiveLayoutForKeyboard(SKeyboard*); Vector2D getMouseCoordsInternal(); @@ -120,13 +119,12 @@ class CInputManager { bool m_bWasDraggingWindow = false; // for refocus to be forced - CWindow* m_pForcedFocus = nullptr; + CWindow* m_pForcedFocus = nullptr; - SDrag m_sDrag; + SDrag m_sDrag; - std::list<SConstraint> m_lConstraints; - std::list<SKeyboard> m_lKeyboards; - std::list<SMouse> m_lMice; + std::list<SKeyboard> m_lKeyboards; + std::list<SMouse> m_lMice; // tablets std::list<STablet> m_lTablets; @@ -145,25 +143,28 @@ class CInputManager { // Exclusive layer surfaces std::deque<SLayerSurface*> m_dExclusiveLSes; - void newTabletTool(wlr_input_device*); - void newTabletPad(wlr_input_device*); - void focusTablet(STablet*, wlr_tablet_tool*, bool motion = false); - void newIdleInhibitor(wlr_idle_inhibitor_v1*); - void recheckIdleInhibitorStatus(); + // constraints + std::vector<CConstraint*> m_vConstraints; + + void newTabletTool(wlr_input_device*); + void newTabletPad(wlr_input_device*); + void focusTablet(STablet*, wlr_tablet_tool*, bool motion = false); + void newIdleInhibitor(wlr_idle_inhibitor_v1*); + void recheckIdleInhibitorStatus(); - void onSwipeBegin(wlr_pointer_swipe_begin_event*); - void onSwipeEnd(wlr_pointer_swipe_end_event*); - void onSwipeUpdate(wlr_pointer_swipe_update_event*); + void onSwipeBegin(wlr_pointer_swipe_begin_event*); + void onSwipeEnd(wlr_pointer_swipe_end_event*); + void onSwipeUpdate(wlr_pointer_swipe_update_event*); - SSwipeGesture m_sActiveSwipe; + SSwipeGesture m_sActiveSwipe; - SKeyboard* m_pActiveKeyboard = nullptr; + SKeyboard* m_pActiveKeyboard = nullptr; - CTimer m_tmrLastCursorMovement; + CTimer m_tmrLastCursorMovement; - CInputMethodRelay m_sIMERelay; + CInputMethodRelay m_sIMERelay; - void updateKeyboardsLeds(wlr_input_device* pKeyboard); + void updateKeyboardsLeds(wlr_input_device* pKeyboard); // for shared mods uint32_t accumulateModsFromAllKBs(); |
