diff options
| author | memchr <118117622+memchr@users.noreply.github.com> | 2024-06-07 17:52:15 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-07 19:52:15 +0200 |
| commit | 41e1147dfc3319ccac0ed11bbbe8f3c77f8b635f (patch) | |
| tree | b9152be3997de2005f57635b78efca1383f6c965 /src/desktop/Window.hpp | |
| parent | 9bc00897fcc896c49a83f55da9de2427e878401a (diff) | |
input: add cursor:persistent_warps to maintain relative position within a window (#6338)
Allows the cursor to return to its last relative position within a window when the window is refocused.
Allows the cursor to retain its relative position within a window when the window is swapped, moved, changed workspace, added to or removed from groups.
controlled with cursor:persistent_warps
Diffstat (limited to 'src/desktop/Window.hpp')
| -rw-r--r-- | src/desktop/Window.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/desktop/Window.hpp b/src/desktop/Window.hpp index d4e26d5d..151d9809 100644 --- a/src/desktop/Window.hpp +++ b/src/desktop/Window.hpp @@ -245,8 +245,11 @@ class CWindow { Vector2D m_vFloatingOffset = Vector2D(0, 0); // this is used for pseudotiling - bool m_bIsPseudotiled = false; - Vector2D m_vPseudoSize = Vector2D(1280, 720); + bool m_bIsPseudotiled = false; + Vector2D m_vPseudoSize = Vector2D(1280, 720); + + // for recovering relative cursor position + Vector2D m_vRelativeCursorCoordsOnLastWarp = Vector2D(-1, -1); bool m_bFirstMap = false; // for layouts bool m_bIsFloating = false; @@ -446,6 +449,7 @@ class CWindow { void onResourceChangeX11(); std::string fetchTitle(); std::string fetchClass(); + void warpCursor(); // listeners void onAck(uint32_t serial); |
