Commit Graph

29 Commits

Author SHA1 Message Date
Vaxry fb15b7aa2a core: Move to hyprutils for Math
Moves CRegion, CBox and Vector2D over to hyprutils.

Requires hyprutils>=0.1.4
2024-06-19 16:20:15 +02:00
Vaxry 8c64a4bad7
core: move to hyprutils for utils (#6385)
* core: move to hyprutils for utils

Nix: add hyprutils dep

* Meson: add hyprutils dep

* flake.lock: update

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2024-06-11 17:17:45 +02:00
Brenno Lemos 33a7b7bb6b
core: fix on-empty workspace being called too often (#6026) 2024-05-12 00:03:32 +01:00
Vaxry 1ed1ce9506
internal: new shared_ptr and weak_ptr implementation (#5883)
moves std::shared_ptrs to a new implementation

Advantages:
- you can dereference a weak_ptr directly. This will obviously segfault on a nullptr deref if it's expired.
   - this is useful to avoid the .lock() hell where we are 100% sure the pointer _should_ be valid. (and if it isn't, it should throw.)
- weak_ptrs are still valid while the SP is being destroyed.
   - reasoning: while an object (e.g. CWindow) is being destroyed, its `weak_ptr self` should be accessible (the sp is still alive, and so is CWindow), but it's not because by stl it's already expired (to prevent resurrection)
   - this impl solves it differently. w_p is expired, but can still be dereferenced and used. Creating `s_p`s is not possible anymore, though.
   - this is useful in destructors and callbacks.
2024-05-05 17:16:00 +01:00
Vaxry bca7804bb6
internal: Window storage rework - part 1 (#5762)
* Window storage rework - part 1

* format

* remove useless include

* fix pch

* format

* fix crash in dwindle

* fix vram leak

* prefer .expired() for bool checks
2024-04-27 12:43:12 +01:00
Agent00Ming 81bb4eb2f6
workspace: Fix duplication of "special:" in special workspace name (#5729)
* Fix duplication of "special:" in special workspace name
	modified:   src/desktop/Workspace.cpp

* Track default special workspace name as special:special
This is to fix the edge cases with the previous commit without breaking
user configs.

	modified:   src/helpers/MiscFunctions.cpp

---------

Co-authored-by: Agent_00Ming <agent00ming9366@gmail.com>
2024-04-24 16:07:22 +01:00
thejch 7c3bd4c19f
workspace: Add fullscreen workspace selector (#5640)
* add fullscreen selector

* use stoi
2024-04-21 01:50:08 +01:00
zakk4223 4d0a635237
workspace: Add 'v' flag for workspace selector that counts only visible windows (#5628)
* Add 'v' flag for workspace selector: counts only visible windows

* extra commit because I'm dumb

* guard
2024-04-19 02:44:51 +01:00
thejch 582d6233c8
workspace: fix workspace name selector returning true early (#5571) 2024-04-13 01:55:17 +01:00
Sungyoon Cho fcac25bcc2
workspace: Add count group flag in windowCount workspace selector prop (#5499)
* Add groupCount workspace selector prop

* Intergrate groupCount with windowCount
2024-04-09 12:08:38 +01:00
Tom Englund 125a8f7e07
workspace: fix crash on destruction of compositor (#5495)
when the compositor destructs because of exiting hyprland the
hookmanager and eventmanager is already destroyed, add an if check in
the destructor of workspace so it doesnt segfault on exit.
2024-04-08 18:28:11 +01:00
staz 1596e2d1f7
workspacerules: add back on-created-empty functionality (#5452)
* workspacerules: add back on-created-empty functionality

* clang format

* workspacerules: spawn on-created-empty window while initializing CWorkspace

* clang format

* configManager: fix typo

---------

Co-authored-by: Your Name <you@example.com>
2024-04-06 15:53:32 +01:00
Vaxry 094bce8118 core: simplify sanityCheckWorkspaces 2024-04-05 19:43:51 +01:00
Vaxry f815a33f64 workspace: remove monitor and visible flags on inert 2024-04-05 16:57:49 +01:00
thejch 1e8f57c734
workspacerules: fix workspace rule loops (#5433) 2024-04-05 16:54:30 +01:00
Vaxry 347b839034 workspaces: add visible flag 2024-04-03 10:09:48 +01:00
MightyPlaza 153c8f35ce
workspace: fix special unnamed workspace rules (#5390)
modified:   src/desktop/Workspace.cpp
2024-04-02 22:58:45 +01:00
Vaxry ef23ef60c5
Workspace/core: Refactor workspace storage (#5380)
* refactor workspaces to use ptrs

* clang-format
2024-04-02 20:32:39 +01:00
Vaxry 2e5b146e57 workspace: remove lastFocusedWindow on unmap 2024-04-02 12:10:03 +01:00
thejch 16a9c16d9f
renderer/animations: Fix various inaccurate damage tracking issues and offsets (#5297) 2024-03-31 02:14:26 +01:00
thejch 5e8c25d498
core: match all workspace rules instead of the first one only (#5340) 2024-03-31 00:49:53 +00:00
Vaxry 2930c5cb6f animvar: fixup update callbacks and cleanup 2024-03-29 00:23:23 +00:00
Vaxry 361357095c workspace: fix selectors with special:
fixes #5187
2024-03-20 18:06:03 +00:00
thejch 95ac8a34b1
workspace: fix integer overflow in selector parser (#5177) 2024-03-20 02:33:39 +00:00
Vaxry 05cd6d3df1 config/workspace: added workspace selectors 2024-03-19 20:56:20 +00:00
Aaron 5920c6a6b8
socket2: Add 5 IPC event with support for workspace ID (#5022)
- `moveworkspacev2`:    returns workspaceID,workspaceName,monitorName
- `movewindowv2`:       returns windowAddress,workspaceID,workspaceName
- `createWorkspacev2`:  returns workspaceID,workspaceName
- `destroyWorkspacev2`: returns workspaceID,workspaceName
- `workspacev2`:        returns workspaceID,workspaceName

- Include workspaceID as a parameter in CWorkspace constructor to support `createWorkspacev2`.

Resolves #4929
2024-03-08 17:39:53 +00:00
Vaxry 063708df26 config: improve config value infrastructure 2024-03-03 18:41:38 +00:00
GartoxFR b2c3440477
animations: Refactor AnimatedVariable (#4911)
* 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
2024-03-02 00:35:17 +00:00
Vaxry b39dcfa497 refactor: move a few things to desktop/ 2024-02-29 13:03:38 +00:00
Renamed from src/helpers/Workspace.cpp (Browse further)