Commit Graph

54 Commits

Author SHA1 Message Date
Vaxry 37e1411e8d
core/surface/buffer: Buffer lock/release fixes (#7110) 2024-07-31 21:47:26 +02:00
MightyPlaza e989a0bcff
internal: refactor fullscreen states (#7104)
* 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
2024-07-31 19:55:52 +02:00
MightyPlaza ad711ef421
input: unify removing currentlyDraggedWindow (#7071)
modified:   src/desktop/Window.cpp
modified:   src/events/Windows.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/KeybindManager.hpp
modified:   src/managers/input/InputManager.cpp
2024-07-27 17:46:19 +01:00
Vaxry 016da234d0
Core: Move to aquamarine (#6608)
Moves Hyprland from wlroots to aquamarine for the backend.

---------

Signed-off-by: Vaxry <vaxry@vaxry.net>
Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
Co-authored-by: vaxerski <vaxerski@users.noreply.github.com>
Co-authored-by: UjinT34 <41110182+UjinT34@users.noreply.github.com>
Co-authored-by: Tom Englund <tomenglund26@gmail.com>
Co-authored-by: Ikalco <73481042+ikalco@users.noreply.github.com>
Co-authored-by: diniamo <diniamo53@gmail.com>
2024-07-21 13:09:54 +02:00
Tim Waterhouse 45c4898423
socket2: Add windowtitlev2 event which includes the window address (#6856)
Fixes #5393
2024-07-13 16:21:32 +02:00
MightyPlaza a443902abc
core: Improve handling of window properties (#6776)
* add mWindowProperties

modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp

* support int values
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp

* create m_sWindowData

modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/AnimationManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

* simplify some properties
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/managers/KeybindManager.cpp

* store multiple values in CWindowOverridableVar
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/AnimationManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

* clean up
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/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/IHyprLayout.hpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/KeybindManager.cpp

* use SET_PROP priority for exec rules
modified:   src/config/ConfigManager.hpp
modified:   src/desktop/Window.cpp

* add default value
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp

* add setprop toggle
modified:   src/config/ConfigManager.hpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp

* add setprop toggle
modified:   src/debug/HyprCtl.cpp

* make window rules functional
modified:   src/config/ConfigManager.cpp
modified:   src/desktop/Window.cpp

* minor fixes
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.hpp

* properly clean layout data
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/layout/IHyprLayout.hpp
modified:   src/layout/MasterLayout.cpp

* remove newline
modified:   src/events/Windows.cpp

* fixes
modified:   src/config/ConfigManager.hpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp

* use CamelCase
modified:   src/Compositor.cpp
modified:   src/debug/HyprCtl.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
modified:   src/events/Windows.cpp
modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/AnimationManager.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/XWaylandManager.cpp
modified:   src/render/OpenGL.cpp
modified:   src/render/Renderer.cpp
modified:   src/render/decorations/CHyprBorderDecoration.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
2024-07-11 16:10:42 +02:00
Tom Englund d7ea1b7785
xwayland: break cyclic loop of parents (#6722)
in X11 some surfaces is a parent of itself and creates a cyclic loop
when trying to find its parent. check for old parent and break if its
beginning to roll over.
2024-07-01 00:26:08 +02:00
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 91fe58f8f2 window: improve swallowing functionality
cleanups, fixes, etc.

ref #6095
2024-06-15 18:20:41 +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
Vaxry 6967a31450
wayland/core: move to new impl (#6268)
* wayland/core/dmabuf: move to new impl

it's the final countdown
2024-06-08 10:07:59 +02:00
memchr 41e1147dfc
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
2024-06-07 19:52:15 +02:00
Vaxry b30c7125d7 window: avoid nullptr deref on monitor in box helpers
fixes #6321
2024-06-03 21:09:18 +02:00
shezdy 0ebb43c1a3
renderer: fix xwayland solitary rechecks (#6295) 2024-06-01 20:45:30 +02:00
giskard ebf258788e
config: add tag dispacther and window rule (#6211) 2024-05-28 23:37:24 +02:00
Vaxry addd3e7f1a
xwayland: move to hyprland impl (#6086) 2024-05-25 22:43:51 +02:00
Vaxry 52684b7d90 window: fix invalid env buffer size in getEnv 2024-05-24 20:40:15 +02:00
Vaxry 3775776a07 window: guard monitor in bounding box calculations
fixes #6190
2024-05-22 22:37:16 +02:00
Vaxry fe23d2b639 window: verify suppress flags in onUpdateState
ref #6108
2024-05-17 19:54:05 +01:00
Vaxry 0cfdde3d1a xdg-shell: move to new impl 2024-05-14 23:02:24 +01:00
MightyPlaza c19903eaf8
windowrules add focusonactivate (#5976)
modified:   src/config/ConfigManager.cpp
modified:   src/desktop/Window.cpp
modified:   src/desktop/Window.hpp
2024-05-10 12:27:54 +01:00
Vaxry ed411f53bd cursor: move to a hyprland impl
This moves wlr_cursor to a completely new impl mostly under
CPointerManager

Also adds beginSimple to OpenGL for simple render passes (e.g. cursor)
2024-05-09 13:37:39 +01:00
Vaxry 5e7925eaeb foreign-toplevel: bypass no activate focus checks
ref #5939

those are used by focus switchers so they should bypass stuff like focus_on_activate = false
2024-05-08 01:31:22 +01:00
Vaxry 598bbd186b window: avoid uaf on updateWindow decos
TODO, make these pointers SP to avoid this in the future.

fixes #5909
2024-05-07 17:37:06 +01:00
VPavliashvili 375e77e398
ipc: add togglegroup, moveintogroup and moveoutofgroup events (#5866) 2024-05-07 12:00:55 +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
JManch 2d40046f24
windows: set fullscreen border size to 0 (#5865) 2024-05-04 12:07:36 +01:00
Gabriel Ford 0623cfabc9
windowrules: Fix Floating Grouped Windows Crash and Bug. (#5826)
* Don't unhide grouped items.

* Remove head check as that wasn't always correct.

* Replace lock with expired()

* Remove set hidden from max size.
2024-05-03 02:00:58 +01:00
Vaxry 56de72f357 internal: store matched windowrules and emit event
new event for plugins, windowUpdateRules
2024-05-02 02:18:01 +01:00
zakk4223 d2899a6c27
layout: Trigger layout recalcuation on deco position/size change (#5821)
* Trigger layout recalcuation on deco position/size change

* Remove now unneeded code

* Formatting
2024-05-01 12:59:40 +01:00
Vaxry 86133983a9 xdg-activation: move to new impl 2024-04-29 16:43:24 +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
Vaxry ecf282d331 wlr-foreign-toplevel: move to new impl 2024-04-25 01:10:43 +01:00
Vaxry 608eff600d tokens: add more modes to initial_workspace_tracking
1 is single-shot, 2 is persistent

fixes #5732
2024-04-24 16:16:52 +01:00
Gabriel Ford c3ec16f494 config: Add More Monitor 'Auto' Positions. (#5670)
* Reverse Window Positioning.

* Cleanup old comments and logs.

* Finish Splitting Left and Right offset.

* Forgot to add Auto Left to ConfigManager

* Fix problems with auto_left.

* Nearly finish up and down.

* Finish draft of all four dirs. Testing now.

* Change Y value in moveTo for up and down.

* Format, comment, and cleanup.

* Address Vaxry's feedback.

* Add check to see if auto position is first rule.

* Run clang-format.
2024-04-23 01:49:25 +01:00
Vaxry 29308b94ca windows: add misc:initial_workspace_tracking
By default enabled, will track the initial opened workspace of a window spawned for 2 minutes or until it's moved to a different workspace.

For example: you run a launcher and open an app on workspace 1, but quickly switch to workspace 2. The app will now open on workspace 1 regardless of your switch.
2024-04-23 01:49:23 +01:00
Vaxry e823b5d693 Window: add destroy signal 2024-04-21 16:54:50 +01:00
Vaxry b52a49b4c4
tearing-control: hyprland impl (#5655)
* tearing: hl impl

* format
2024-04-19 22:16:35 +01:00
Sungyoon Cho dd39cd7e42
windows: recalculate monitor after updating windows (#5647)
Recalculate monitor after updating windows, so layout render doesn't get
overridden.
2024-04-19 18:46:16 +01:00
Vaxry 32555e98dd window: remove input ref on unmap
ref #5605
2024-04-16 15:17:54 +01:00
Vaxry dd6fdf49d9 window: always unref workspace on unmap
fixes #5563
2024-04-12 19:52:01 +01:00
Sungyoon Cho c35fa9bacc
workspace: update windows when selector match could change (#5533)
* workspace: update windows when group updates

* workspace: update windows when floating toggle

* workspace: update windows when stop dragging window by mouse
2024-04-10 17:26:11 +01:00
SoSeDiK 1343aa865d
config: Don't override fullscreen opacity if only two opacities are provided (#5512) 2024-04-09 16:22:44 +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
SoSeDiK 43b96f03b5
props: Allow setting per-window fullscreen opacity (#5470) 2024-04-07 23:19:02 +01:00
thejch 1e8f57c734
workspacerules: fix workspace rule loops (#5433) 2024-04-05 16:54:30 +01:00
Vaxry 1454c6213e window: fix invalid last workspace id
ref #5432
2024-04-04 22:49:15 +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
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