Commit graph

731 commits

Author SHA1 Message Date
Tom Englund
4b4971c06f
internal: introduce new types to avoid unsigned int rollover and signed int 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
2024-08-08 21:01:50 +02:00
09bb5658b7 window/ls: reset core signals after destroy
fixes #7137
2024-08-02 00:31:44 +02:00
MightyPlaza
c8873b958d
internal: fix fullscreen typos (#7134)
modified:   src/events/Windows.cpp
modified:   src/layout/DwindleLayout.cpp
2024-08-01 14:59:52 +02:00
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
Ikalco
ec672b1ab9
protocols: move screencopy and toplevel export to hyprwayland-scanner (#7065)
* move screencopy and toplevel export to hyprwayland-scanner

* oops
2024-07-27 16:02:02 +01:00
8a4548e430 window: drop ack requirement for applying pending reported size
fixes #6533
2024-07-23 23:38:58 +02: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
Khiet Tam Nguyen
bd526822de
config: add option to exit window while retaining fullscreen (#516) (#6880)
* feat: saving fullscreen mode and state for restoring later

* style: no p-prefix, capitalised constants
2024-07-15 13:48:04 +02:00
Khiet Tam Nguyen
bc6b0880dd
window: override noMaximize if new window takes over fullscreen (#6812) (#6870) 2024-07-13 20:44: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
はれなよ
1f43a5c859
session: fix activate events being always treated as on (#6696)
* Fix listener_sessionActive to handle an event correctly when the session get inactivated

* Remove log
2024-06-29 20:04:48 +02:00
1d70962892 core: move to steady_clock where applicable
avoid issues when system clock gets desynchronized or changed
2024-06-25 16:05:47 +02:00
Alexander
7f09646ab8
core: add ability to select previous workspace per monitor (#6598)
Co-authored-by: Крылов Александр <aleksandr.krylov@hyperus.team>
2024-06-22 23:52:42 +02:00
91fe58f8f2 window: improve swallowing functionality
cleanups, fixes, etc.

ref #6095
2024-06-15 18:20:41 +02:00
a357fa3e0a window: use effective damage for tearing re-schedules
fixes #6377
2024-06-14 16:45:41 +02:00
Tom Englund
e6d10539af
core: fix a few small memory leaks on exit (#6470)
* renderer: add destructor and destroy event source

add destructor and destroy the event source.
one less leak on exit of compositor reported by asan.

* compositor: cleanup eventloop on exit

destruct hyprctl to release the event sources, and properly cleanup the
event loop on exit of compositor. less leaks on exit reported by asan

* threadmgr: destroy event source on destruction

destroy the event source on destruction.

* eventloopmgr: reset eventloopmgr on exit aswell

reset the eventloopmanager on exit of compositor and free the leaking
last idle frame on monitor destroy.
2024-06-13 12:08:02 +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
Connor Wong
722d537a91
windows: make new_window_takes_over_fullscreen use the new window's workspace (#6263)
* fix new_window_takes_over_fullscreen behavior

* missed a few things
2024-05-27 22:45:32 +02:00
Vaxry
addd3e7f1a
xwayland: move to hyprland impl (#6086) 2024-05-25 22:43:51 +02:00
7eeee2c94e wl-data-device: move to hyprland impl 2024-05-14 23:13:35 +01:00
0cfdde3d1a xdg-shell: move to new impl 2024-05-14 23:02:24 +01:00
121d3a7213 wl_seat: move to hyprland impl 2024-05-14 23:02:24 +01:00
Daniil
1584679004
xwayland: Remove delta for real position with xwayland zero scaling (#6057) 2024-05-14 13:33:20 +01:00
b0861b6709 config: move various cursor-related vars to cursor: 2024-05-09 22:25:20 +01:00
635a02d83f layer-shell: move to new impl
Also bumps the hw-s dep
2024-05-09 22:02:18 +01:00
84e8d1810d Tablet: move to new impl
Ring and strip are not implemented. Will I implement this? God fucking knows. Nobody seems to have that anyways.
2024-05-09 13:37:39 +01:00
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
outfoxxed
05e4a3f1a8
windows: Revert "window: set config only when both props end anims" (#5904)
This reverts commit 7617c03dfd,
fixing a bug that caused the bottom right corner of windows to
animate oddly.
2024-05-06 15:32:01 +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
1237732b97 input: Introduce basic hyprland HID classes
Implements an intermediary HID class for mice, keyboards and touch devices, removing the old structs from WLClasses.hpp

Yes, virtual ones are duplicated a bit, but will likely be de-duped once wlr_input_device is not used anymore.
2024-05-03 22:40:27 +01:00
8a2269272b output-management: move to new impl 2024-05-03 18:08:04 +01:00
Ikalco
387127b12a
config: added option to choose the default monitor for the cursor (#5847)
* added option to choose the default monitor that the cursor will appear in upon startup

* fix: don't set cursor to default monitor after startup

* refactor to checkDefaultCursorWarp also fix focus
2024-05-03 02:39:19 +01:00
2755297670 virtual-pointer: move to new impl 2024-05-03 01:52:05 +01:00
6aa2d123ae virtual-keyboard: move to new impl 2024-05-03 00:31:48 +01:00
56de72f357 internal: store matched windowrules and emit event
new event for plugins, windowUpdateRules
2024-05-02 02:18:01 +01:00
8bcccf9f0f ime-v2: move to new impl 2024-05-01 16:41:17 +01:00
4ed6b69b68 socket2: fix empty activewindowv2 events
fixes #5827
2024-05-01 13:57:32 +01:00
90e1411315 session-lock: move to new impl 2024-04-30 16:34:09 +01:00
5edc32930d layerSurface: refactor/move to a memory-safe impl
Makes all the pointers smart to avoid memory issues
Refactors layerSurface code to live inside desktop/layersurface
2024-04-30 02:41:27 +01:00
86133983a9 xdg-activation: move to new impl 2024-04-29 16:43:24 +01:00
33e0bb1478 wlr-output-power: move to new impl 2024-04-29 01:38:24 +01:00
niki-on-github
55490637aa
windowrules: add subtract window option to move rule (#5770)
Co-authored-by: nix <nix@local>
2024-04-27 17:34:19 +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
25aec3ac8c pointer-constraints: move to new impl 2024-04-27 03:17:04 +01:00
1d40af64d3 text-input-v3: move to new impl 2024-04-25 23:27:44 +01:00
0652a20bd3 events: set window initial* before searching for rules 2024-04-25 16:57:11 +01:00
01df3b73d8 shortcuts-inhibitor: move to new impl 2024-04-25 14:32:35 +01:00