summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authorMozzarella32 <143010987+Mozzarella32@users.noreply.github.com>2025-10-20 13:22:50 +0200
committerGitHub <noreply@github.com>2025-10-20 12:22:50 +0100
commit46dab01bcc47b2e29f36cd4d35d04091e4134a67 (patch)
tree42e79bda2f53b14ce79bdd259c3e4712874abe70 /src/managers
parent474cd004df5c929fc3d7a71e46e8e9e363c21c39 (diff)
renderer: add more uniforms to the screen shader (#11986)
These are: pointer_shape from the cursor-shape-v1 protocol prepared for v2, along with left_ptr...bottom_right_corner and killing (Hyprland specific) pointer_shape_previous with pointer_switch_time to blend between shapes pointer_size scaled size as used by the normal cursor pointer_pressed_positions[32] with pointer_pressed_times[32] and pointer_pressed_killed(32 bits) for click/touch animations and if they killed something pointer_inactive_timeout with pointer_last_active to smoothly fade the pointer out pointer_hidden to hide it when the cursor is hidden (excluding by cursor:invisible as this config value can be used to turn off the normal cursor, which is useful when drawing it with the screen shader)
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/CursorManager.cpp4
-rw-r--r--src/managers/CursorManager.hpp2
-rw-r--r--src/managers/input/InputManager.cpp5
-rw-r--r--src/managers/input/Touch.cpp2
4 files changed, 11 insertions, 2 deletions
diff --git a/src/managers/CursorManager.cpp b/src/managers/CursorManager.cpp
index 442da443..d2905a1e 100644
--- a/src/managers/CursorManager.cpp
+++ b/src/managers/CursorManager.cpp
@@ -342,3 +342,7 @@ bool CCursorManager::changeTheme(const std::string& name, const int size) {
void CCursorManager::syncGsettings() {
m_xcursor->syncGsettings();
}
+
+float CCursorManager::getScaledSize() const {
+ return m_size * m_cursorScale;
+}
diff --git a/src/managers/CursorManager.hpp b/src/managers/CursorManager.hpp
index 03420dab..dd3238af 100644
--- a/src/managers/CursorManager.hpp
+++ b/src/managers/CursorManager.hpp
@@ -55,6 +55,8 @@ class CCursorManager {
void tickAnimatedCursor();
+ float getScaledSize() const;
+
private:
bool m_ourBufferConnected = false;
std::vector<SP<CCursorBuffer>> m_cursorBuffers;
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index 63e08154..ae355b4b 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -4,6 +4,7 @@
#include <cstdint>
#include <hyprutils/math/Vector2D.hpp>
#include <ranges>
+#include <algorithm>
#include "../../config/ConfigValue.hpp"
#include "../../config/ConfigManager.hpp"
#include "../../desktop/Window.hpp"
@@ -716,7 +717,7 @@ void CInputManager::setClickMode(eClickBehaviorMode mode) {
case CLICKMODE_DEFAULT:
Debug::log(LOG, "SetClickMode: DEFAULT");
m_clickBehavior = CLICKMODE_DEFAULT;
- g_pHyprRenderer->setCursorFromName("left_ptr");
+ g_pHyprRenderer->setCursorFromName("left_ptr", true);
break;
case CLICKMODE_KILL:
@@ -728,7 +729,7 @@ void CInputManager::setClickMode(eClickBehaviorMode mode) {
refocus();
// set cursor
- g_pHyprRenderer->setCursorFromName("crosshair");
+ g_pHyprRenderer->setCursorFromName("crosshair", true);
break;
default: break;
}
diff --git a/src/managers/input/Touch.cpp b/src/managers/input/Touch.cpp
index 2d3842f9..631bd569 100644
--- a/src/managers/input/Touch.cpp
+++ b/src/managers/input/Touch.cpp
@@ -124,6 +124,8 @@ void CInputManager::onTouchUp(ITouch::SUpEvent e) {
void CInputManager::onTouchMove(ITouch::SMotionEvent e) {
m_lastInputTouch = true;
+ m_lastCursorMovement.reset();
+
EMIT_HOOK_EVENT_CANCELLABLE("touchMove", e);
if (g_pUnifiedWorkspaceSwipe->isGestureInProgress()) {
// Do nothing if this is using a different finger.