summaryrefslogtreecommitdiff
path: root/src/managers/input
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-01-17 11:47:39 +0100
committervaxerski <vaxry@vaxry.net>2023-01-17 11:47:39 +0100
commit5c83976977462696355c2099c48de72c4c11be59 (patch)
treeae123b460f33acefb268d22e0500858e92d151e0 /src/managers/input
parent2ec7e241cd12d270757267beccd3e490ad6e3360 (diff)
added misc:hide_cursor_on_touch
Diffstat (limited to 'src/managers/input')
-rw-r--r--src/managers/input/InputManager.cpp4
-rw-r--r--src/managers/input/InputManager.hpp37
-rw-r--r--src/managers/input/Touch.cpp2
3 files changed, 25 insertions, 18 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index d1f24884..4f201677 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -21,6 +21,8 @@ void CInputManager::onMouseMoved(wlr_pointer_motion_event* e) {
mouseMoveUnified(e->time_msec);
m_tmrLastCursorMovement.reset();
+
+ m_bLastInputTouch = false;
}
void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) {
@@ -29,6 +31,8 @@ void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) {
mouseMoveUnified(e->time_msec);
m_tmrLastCursorMovement.reset();
+
+ m_bLastInputTouch = false;
}
void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp
index 8e4223eb..ec495d69 100644
--- a/src/managers/input/InputManager.hpp
+++ b/src/managers/input/InputManager.hpp
@@ -26,24 +26,22 @@ struct STouchData {
};
// The third row is always 0 0 1 and is not expected by `libinput_device_config_calibration_set_matrix`
-static const float MATRICES[8][6] = {
- {// normal
- 1, 0, 0, 0, 1, 0},
- {// rotation 90°
- 0, -1, 1, 1, 0, 0},
- {// rotation 180°
- -1, 0, 1, 0, -1, 1},
- {// rotation 270°
- 0, 1, 0, -1, 0, 1},
- {// flipped
- -1, 0, 1, 0, 1, 0},
- {// flipped + rotation 90°
- 0, 1, 0, 1, 0, 0},
- {// flipped + rotation 180°
- 1, 0, 0, 0, -1, 1},
- {// flipped + rotation 270°
- 0, -1, 1, -1, 0, 1}
-};
+static const float MATRICES[8][6] = {{// normal
+ 1, 0, 0, 0, 1, 0},
+ {// rotation 90°
+ 0, -1, 1, 1, 0, 0},
+ {// rotation 180°
+ -1, 0, 1, 0, -1, 1},
+ {// rotation 270°
+ 0, 1, 0, -1, 0, 1},
+ {// flipped
+ -1, 0, 1, 0, 1, 0},
+ {// flipped + rotation 90°
+ 0, 1, 0, 1, 0, 0},
+ {// flipped + rotation 180°
+ 1, 0, 0, 0, -1, 1},
+ {// flipped + rotation 270°
+ 0, -1, 1, -1, 0, 1}};
class CKeybindManager;
@@ -160,6 +158,9 @@ class CInputManager {
// for some bugs in follow mouse 0
bool m_bLastFocusOnLS = false;
+ // for hiding cursor on touch
+ bool m_bLastInputTouch = false;
+
private:
bool m_bCursorImageOverriden = false;
diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp
index 984e0019..b69b4f7b 100644
--- a/src/managers/input/Touch.cpp
+++ b/src/managers/input/Touch.cpp
@@ -15,6 +15,8 @@ void CInputManager::onTouchDown(wlr_touch_down_event* e) {
refocus();
+ m_bLastInputTouch = true;
+
m_sTouchData.touchFocusWindow = m_pFoundWindowToFocus;
m_sTouchData.touchFocusSurface = m_pFoundSurfaceToFocus;
m_sTouchData.touchFocusLS = m_pFoundLSToFocus;