summaryrefslogtreecommitdiff
path: root/src/managers/input/Swipe.cpp
Commit message (Collapse)AuthorAgeFilesLines
* input: Add fully configurable trackpad gestures (#11490)Vaxry2025-08-281-348/+0
| | | Adds configurable trackpad gestures
* refactor: Use new hyprutils casts (#11377)Kamikadze2025-08-141-3/+3
|
* core: move workspace ptrs to weak (#11194)Vaxry2025-07-241-1/+1
| | | | Fixes some race conditions that come up in tests. We only clean up workspaces when we render a frame. With this, they are always cleared instantly.
* swipe: fix workspace swipe not rendering last frame if target ws is on edge ↵Florent Charpentier2025-07-231-0/+2
| | | | | | | | | | (#11184) Fix for a weird behaviour that happens when swipe is only valid in 1 direction (i.e. from ws 1) When you start a swipe from the only direction possible, then swipe back (without releasing), the last frame where the delta is reset to 0 was not being rendered
* inputs: refactor class member vars (#10230)davc0n2025-05-011-86/+86
|
* helpers: refactor class member vars (#10218)davc0n2025-04-301-9/+9
|
* workspaces: refactor class member vars (#10167)davc0n2025-04-251-63/+63
|
* layers: refactor class member vars (#10149)davc0n2025-04-241-2/+2
| | | | | * layers: refactor class member vars * popups: rename m_WLSurface to m_wlSurface
* compositor: refactor class member vars (#10141)davc0n2025-04-221-6/+6
|
* swipe: fix swiping onto a new workspace bound to another monitor (#8176) (#9927)kerty02025-04-071-12/+1
| | | | | | | | | | | | | | | | | The previous code didn't check if the chosen new workspace was bound to another monitor, causing buggy behavior where workspace was simultaneously open and not. The fix simply uses `r+1` for new workspace selection. Also, the previous code would select rightmost workspace + 1, creating large gaps in workspace IDs in some scenarios. Example (`()` and `[]` indicate workspaces on different monitors): `(1), 2, 3, 4, 5, 6, 7, 8, 9, [10]` Swipe right on `()` monitor would create: `(1), 2, 3, 4, 5, 6, 7, 8, 9, [10], (11)` But with this commit: `(1), (2), 3, 4, 5, 6, 7, 8, 9, [10]`
* swipe: fix prev workspace rememberingVaxry2025-04-061-0/+2
| | | | fixes #9904
* core: cleanup header includes (#9088)user1111111111111111111111111111111112025-01-171-0/+3
| | | Cleanup some unneeded includes to speed up compilation
* core: move parts of the animation system to hyprutils (#8868)Maximilian Seidler2025-01-071-61/+61
| | | | | | | | | | | | | * core: change animation manager to use Hyprutils::Animation * config: move animation config to hyprutils animation tree * use g_pAnimationManager->createAnimation and the new PHLANIMVAR template * core: use CGenericAnimatedVariabled::{enabled,setConfig,getStyle} and adapt callbacks * core: adapt animated variable usage (dereference the shared pointer) * misc: bump CMakeLists to hyprutils 0.3.3
* core: workspace-related function cleanup / refactorVaxry2024-11-221-7/+6
| | | | CCompositor is massive, and has a lot of functions that could be better optimized if in CWorkspace
* core: move internal structures to monitor pointers (#8266)Vaxry2024-10-271-2/+1
|
* internal: Move CMonitor to SP (#8178)Vaxry2024-10-191-5/+5
| | | | | * move monitors to sp * XD
* core: make most for loops use const references (#7527)Tom Englund2024-08-261-3/+3
| | | | why not let the compiler optimise things for us at hyprspeeds when we can.
* internal: introduce new types to avoid unsigned int rollover and signed int ↵Tom Englund2024-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | overflow (#7216) * framebuffer: avoid gluint overflow GLuint was being initialized to -1 and rolling over to unsigned int max, its defined behaviour but very unnecessery. add a bool and use it for checking if allocated or not. * opengl: avoid gluint rollover -1 rolls over to unsigned int max, use 0xFF instead. * core: big uint64_t to int type conversion there were a few uint64_t to int implicit conversions overflowing int and causing UB, make all monitor/workspaces/windows use the new typedefs. also fix the various related 64 to 32 implicit conversions going around found with -Wshorten-64-to-32
* internal: refactor fullscreen states (#7104)MightyPlaza2024-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor fullscreen modified: src/Compositor.cpp modified: src/Compositor.hpp modified: src/config/ConfigManager.cpp modified: src/config/ConfigManager.hpp modified: src/debug/HyprCtl.cpp modified: src/desktop/LayerSurface.cpp modified: src/desktop/Window.cpp modified: src/desktop/Window.hpp modified: src/desktop/Workspace.cpp modified: src/desktop/Workspace.hpp modified: src/events/Windows.cpp modified: src/helpers/Monitor.cpp modified: src/layout/DwindleLayout.cpp modified: src/layout/DwindleLayout.hpp modified: src/layout/IHyprLayout.cpp modified: src/layout/IHyprLayout.hpp modified: src/layout/MasterLayout.cpp modified: src/layout/MasterLayout.hpp modified: src/managers/KeybindManager.cpp modified: src/managers/KeybindManager.hpp modified: src/managers/input/IdleInhibitor.cpp modified: src/managers/input/InputManager.cpp modified: src/managers/input/Swipe.cpp modified: src/protocols/ForeignToplevelWlr.cpp modified: src/render/Renderer.cpp modified: src/render/decorations/CHyprGroupBarDecoration.cpp * clean up modified: src/config/ConfigManager.cpp modified: src/debug/HyprCtl.cpp modified: src/desktop/Window.hpp modified: src/desktop/Workspace.cpp modified: src/events/Windows.cpp modified: src/managers/KeybindManager.cpp modified: src/managers/input/Swipe.cpp * fix mapWindow fullscreen modified: src/events/Windows.cpp * fix typo modified: src/desktop/Workspace.cpp * add fullscreenstate modified: src/config/ConfigManager.cpp modified: src/events/Windows.cpp * change syncFullscreen to lower modified: src/config/ConfigManager.hpp * initialize fs state modified: src/desktop/Window.hpp
* core: add ability to select previous workspace per monitor (#6598)Alexander2024-06-221-7/+5
| | | Co-authored-by: Крылов Александр <aleksandr.krylov@hyperus.team>
* core: Move to hyprutils for MathVaxry2024-06-191-20/+20
| | | | | | Moves CRegion, CBox and Vector2D over to hyprutils. Requires hyprutils>=0.1.4
* gestures: Add gestures:workspace_swipe_min_fingers option (#6342)John M. Harris, Jr2024-06-071-4/+5
| | | | | | | | | | When gestures:workspace_swipe_min_fingers is enabled, gestures:workspace_swipe_fingers is considered to be the minimum number of fingers required to swipe. This behavior is more similar to sway and macOS's default behavior. For example, this allows you to set workspace_swipe_fingers to 3, but swipe with 4 or more fingers instead of 3.
* layer-shell: move to new implVaxry2024-05-091-2/+2
| | | | Also bumps the hw-s dep
* cursor: move to a hyprland implVaxry2024-05-091-7/+7
| | | | | | | This moves wlr_cursor to a completely new impl mostly under CPointerManager Also adds beginSimple to OpenGL for simple render passes (e.g. cursor)
* swipe: fix crashes with invalid distanceVaxry2024-04-261-18/+20
| | | | fixes #5758
* swipe: nuke numberedVaxry2024-04-111-8/+6
| | | | | | fixes #5424 use_r instead
* swipe: add eventsVaxry2024-04-031-0/+6
|
* Workspace/core: Refactor workspace storage (#5380)Vaxry2024-04-021-7/+7
| | | | | * refactor workspaces to use ptrs * clang-format
* swipe: fix nullptr in `onSwipeUpdate` (#5191)Horror Proton2024-03-201-2/+2
|
* swipe: Touchscreen workspace swipe (#4489)Zach DeCook2024-03-171-4/+14
| | | | | | | | | * Workspace Swipe: Refactor update and end functions * Touch: Implement workspace swipe better ignoring additional fingers and new touches allow gaps-right and gaps-left to be different
* config: improve config value infrastructureVaxry2024-03-031-56/+57
|
* animations: Refactor AnimatedVariable (#4911)GartoxFR2024-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | * animation: Refactor AnimatedVariable This commit decomposes the AnimatedVariable class into a base class with the common attribute to all variable types and a templated derived type containing strongly typed info on the type being animated. Access to the typed version is perfomed using the visitor pattern. A utility is provided to build a visitor on the fly using lambdas. Adding a new type to be animated should just be a matter of adding the typed in the list defined by the ANIMABLE_TYPES macro The size of the commit is justified by the API change in the AnimatedVariable class. No more vec(), fl() or col() method but a unified value() method. * animation: Remove visitor pattern * animation: Fix coding style * animation: Fix coding style
* Migrate the config to hyprlang (#4656)Vaxry2024-02-181-58/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Migrate to hyprlang * pop up errors * fix swapped args * Meson & Nix: build with hyprlang * CI: add hyprlang to setup action * add infra for plugin stuff * fix hyprctl getoption * fix hyprctl getoption with json * format * fix post parse logic * fix autogen config * oops missed exec-once * fmt * fix ws rules * require 0.3.0 for hyprlang * nix: flaek * minor type fixes * fix cfg usages in swipe * use cvarlist for ws rules * fix throw in addPluginConfigVar * Nix: update hyprlang * minor fixes * fix disableLogs * mention hyprlang docs * bump hyprlang dep in cmake * Meson: bump min hyprlang version Nix: update hyprlang * minor fix * Nix: update meson patch --------- Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
* swipe: Prevent hiding current workspace when swiping (#4417)scorpion-262024-01-111-2/+2
| | | | | | | When workspace_swipe_use_r is enabled, swiping from WS 1 to a non-empty WS 2 would hide WS 1 (Similar effect to issue #4076). This is caused by a faulty check which doesn't consider, that workspaceIDLeft could be the current workspace. This bug is only a problem for r, because m wraps around on WS 1 m-1, whereas r stays on WS 1.
* style/ci: apply clang-format and verify it in ci (#4039)François Conzelmann2023-12-061-32/+20
| | | | | * style: apply clang-format * ci: add new clang-format job to CI
* general: add workspace gaps (#3877)end-42023-11-191-35/+50
| | | | | | | | | | | | | | | | | | | | | * anims: workspace gap * anims: ws gaps: on swipe end * anims: ws gaps: add missing parentheses * format * refractor * Update Swipe.cpp * format * fix swipe to right * ws gaps: move animations:workspace_gap to general:gaps_workspace * ws gaps: general:gaps_workspace -> general:gaps_workspaces
* internal: replace INT_MAX with WORKSPACE_INVALIDVaxry2023-11-121-1/+1
|
* cleanup: Replace find() with C++20 starts_with(), ends_with() and contains() ↵Philip Damianik2023-10-151-2/+2
| | | | | | | (#3572) * Replace find() with C++20 starts_with() and ends_with() * Replace find() with C++20 contains()
* fix: inconsistent behaviour where last workspace was not saved (#3261)memchr2023-09-111-0/+1
|
* internal: Remove all `.c_str()` calls when using `std::vformat` (#3198)Philip Damianik2023-09-061-1/+1
| | | Signed-off-by: pdamianik <39028343+pdamianik@users.noreply.github.com>
* internal: Formatter rework (#3186)Vaxry2023-09-061-1/+1
|
* gestures: Swipe direction lock (#3052)end-42023-08-231-8/+18
|
* animations: add slidefade and slidefadevert styles for workspaces (#3008)end-42023-08-171-2/+4
| | | | | | | | | | | | | | | * add slidefade and slidefadevert animations * fix swiping for slidefadevert * rename minPerc to movePerc for slidefade anim styles * change default slidefade percentage to 100% * remove useless comments * findlastof + 1 * debug logging for slidefade/slidefadevert percentage
* swipe: fix mixup of r/mvaxerski2023-07-041-2/+2
|
* gestures: add workspace_swipe_use_rvaxerski2023-07-011-4/+6
|
* internal: workspace manip handling reworkvaxerski2023-04-141-4/+4
|
* Fix swiping onto a new workspace with multiple monitors. (#1971)Andrew Pritchard2023-04-071-4/+16
| | | | | | | | | | | | | | | | | | | | | The previous code could run into issues into the following circumstances: * The focused monitor is on its rightmost workspace with ID `i`. * Another monitor has a workspace with ID `i+1`. * `workspace_swipe_create_new` is enabled. Then, swiping rightwards attempts to target a new workspace with ID `i+1`: completing the swipe gesture unintentionally focuses that workspace on whichever monitor it's already on while leaving the active monitor in a broken state where it shows no windows but creates new windows on the workspace it was previously on; and cancelling the swipe gesture shifts the entire workspace `i+1` to the right by the width of the active monitor. By choosing an ID that doesn't exist, this problematic behavior is avoided. More specifically, it's the smallest ID greater than any existing workspace's ID, because otherwise the new workspace that was seemingly just created to the right of the rightmost workspace could end up somewhere in the middle of the workspace order.
* swipe: block on locked sessionvaxerski2023-04-071-1/+1
|
* remove old comment and fixup lsl var namevaxerski2023-01-221-2/+2
|
* Normalize color storagevaxerski2023-01-051-8/+8
| | | | | | Colors are now normalized to 0 - 1 values instead of 0 - 255 causes calculations to be simpler and generally cleans up the codebase.