Commit graph

692 commits

Author SHA1 Message Date
trianta
bd6d6e7f33
xwayland: add option to enable/disable xwayland (#7633)
* config: add xwayland enabled option to config

* xwayland: use DISPLAY env variable for enable/disable of new launches

* xwayland: close X11 windows when turning of XWayland

* clang: format fix

* config: add better description for xwayland:enabled

* xwayland: close X11 windows on disable without crashes

* xwayland: better method of informing CXWayland if xwayland enabled

* xwayland: prevent closing non-xwayland windows on disable

* misc: loop formatting
2024-09-05 17:26:46 +01:00
Maximilian Seidler
027140b731
sessionLock: ensure sls focus in some edge cases (#7647)
* input: return early in mouseMoveUnified when the session is locked

* sessionLock: make make a commit an opportunity to focus session lock surfaces

* compositor: allow resetting focus when session is locked

* input: remove redundant PMONITOR checks

PMONITOR is checked above

* input: check isSessionLocked earlier in mouseMoveUnified

A bit of reordering, so that we don't call some stuff that is irrelevant
when the session is locked
2024-09-04 16:59:00 +01:00
1c9d56998d xdg-dialog: implement new protocol 2024-08-30 15:53:44 +02:00
25e72949a1 window/xwayland: minor property cleanup
fixes #6921
2024-08-30 14:12:23 +02:00
Tom Englund
72c7818ae6
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
2024-08-26 20:24:30 +02:00
Tom Englund
8d6c18076f
core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we
can.
2024-08-26 17:25:39 +02:00
Adithya Ajith
ca85455a8e
misc: Rename all instances of "emtpy" to "empty" (#7522) 2024-08-26 12:25:52 +02:00
Sungyoon Cho
688fe5c147
windowrules: add fullscreenstate field (#7466)
* windowrules: add fullscreenstate field

* fix typo
2024-08-23 20:42:14 +01:00
c86db7bbb0 monitor: avoid dangling references to old monitors being undestroyed
ref #7414
2024-08-19 18:44:22 +02:00
Tom Englund
5afc4dc42e
compositor: update suspendstate on window move (#7396)
hyprctl dispatch -- movetoworkspacesilent x,"^kitty$" where X is the
current workspace makes kitty stops updating until current workspace is
changed while it is on the screen. update the suspend state after it has
been moved.
2024-08-18 20:02:46 +01:00
Vladimir-csp
682b30fba8
env: Add HYPRLAND_NO_SD_VARS env condition (#7358)
* Add HYPRLAND_NO_SD_VARS env condition

wip #7083

* Formatting shuffle

* Formatting
2024-08-16 08:19:08 +01:00
Vladimir-csp
15f942000e
core: Preserve existing XDG_CURRENT_DESKTOP (#7347)
* Preserve existing XDG_CURRENT_DESKTOP

* fix

---------

Co-authored-by: vaxerski <vaxry@vaxry.net>
2024-08-15 17:14:48 +01:00
Ikalco
39df1f4dbf
cursormgr: fix cursor gsettings on session change (#7295) 2024-08-13 18:27:00 +01:00
Tom Englund
3fa6db1e7a
core: fix data race and a unsigned int rollover (#7278)
* keybindmgr: avoid uint rollover on mouse keycode

mouse keycode is 0, and the switch case checks for 0 - 8 and rolls over,
just return early if keycode is 0.

* watchdog: avoid data races in watchdog

asan thread sanitizer reported data races in the watchdog from reading
and setting the bool variables make them std::atomic bools. also add a
atomic bool for the main thread to wait for to avoid data race when
reading the config values.

* hyprdebug: change non unicode character to name

asan created false positives and didnt like this bit, so for the sake of
easier debugging rename it to something unicode.
2024-08-12 18:19:03 +01:00
Tom Englund
511eea71c6
pointermgr: fix initial cursorwarp (#7286)
change the hook to monitorAdded instead of newMonitor so its finalized
in the compositor and added to vMonitors, move the
checkDefaultCursorWarp to PointerManager and check for it upon mode
change. and also ensure it doesnt go out of bounds by replacing it in
the middle again on resolution changes.
2024-08-11 19:42:18 +01:00
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
Agent00Ming
3e00d7dde7
compositor: fix general:extend_border_grab_area (#7214)
Co-authored-by: Agent_00Ming <agent00ming9366@gmail.com>
2024-08-07 16:36:20 +02:00
f36c625e37 compositor: minor cleanups for fading out layers 2024-08-07 13:35:02 +02:00
Vaxry
640d161851
renderer: Explicit sync fixes (#7151)
Enables explicit sync by default for most platforms

`misc:no_direct_scanout` -> `render:direct_scanout`
2024-08-06 15:52:19 +02:00
Jan Beich
9f5a57ff45
core: Add missing header for libc++ after e989a0bcff (#7158)
src/Compositor.cpp:2295:74: error: no member named 'bit_floor' in namespace 'std'
 2295 |     const eFullscreenMode CURRENT_EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)PWINDOW->m_sFullscreenState.internal);
      |                                                                     ~~~~~^
src/Compositor.cpp:2296:74: error: no member named 'bit_floor' in namespace 'std'
 2296 |     const eFullscreenMode EFFECTIVE_MODE         = (eFullscreenMode)std::bit_floor((uint8_t)state.internal);
      |                                                                     ~~~~~^
src/desktop/Window.cpp:1242:34: error: no member named 'bit_floor' in namespace 'std'
 1242 |     return (eFullscreenMode)std::bit_floor((uint8_t)m_sFullscreenState.internal) == MODE;
      |                             ~~~~~^
2024-08-03 13:02:10 +01:00
Sungyoon Cho
8c02b3c267
layout: fix dynamic rules not updating after setting fullscreen (#7129) 2024-08-01 11:43:02 +02:00
Tom Englund
5489682799
internal: some minor fd/socket cleanups and make logging thread safe (#7123)
* bezier: dont loop on float values

Using a floating-point loop variable with a fixed increment can cause precision
errors over time due to the nature of floating-point arithmetic.
and cause undesired effects.

ex
iteration 1 = 0.10000000149011611938
iteration 2 = 0.20000000298023223877

eventually..

iteration 8 = 0.80000001192092895508
iteration 9 = 0.89999997615814208984

* hyprctl: close sockets on destruction

store socketpath and close the fd and unlink the socket path on exit.

* eventloopmgr: close the timerfd

close the timerfd on exit.

* debug: make logging thread safe

instead of opening and closing the logfile on each write open it on init
and close it on compositor exit. also add a mutex so accidently using
logging from a thread like the watchdog or similiar doesnt cause issues.

* xwl: clean up fd logic

check if the fd is actually opened before closing, and close the
pipesource FD on exit.
2024-07-31 21:00:14 +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
jim3692
10e631053a
compositor: fix log typos (#7111) 2024-07-30 13:50:13 +02:00
Ikalco
3e543d2ce8
core: Properly shutdown wl display (#7018)
* correctly destroy wayland globals

* properly shutdown and cleanup hyprland

* appease the nitpick gods and some comments
2024-07-24 19:07:36 +02:00
99088eaed8 compositor: simplify getWindowFromSurface 2024-07-24 11:07:28 +02:00
Ikalco
e8374e0792
debug: get rid of useless 1s in logs (#6969)
* get rid of 1s in logs lol

* replace WLR with AQ in logs
2024-07-22 18:06:11 +02:00
diniamo
d03fa94c2c
core: avoid locking 2 wayland sockets (#6971)
* fix: avoid locking 2 wayland sockets

* format

* fix formatting
2024-07-22 13:16:25 +02:00
672bf1f867 compositor: ignore setting surface scanout if DS is disabled 2024-07-21 23:52:16 +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
Ferdinand Bachmann
efccf25fcc
compositor: implement wayland socket handover (#6930)
* compositor: implement wayland socket handover

This commit implements the compositor side of the Wayland socket
handover protocol as described in the [KDE Wiki]. The CLI options are
chosen so that they are compatible with Kwin.

[KDE Wiki]: https://invent.kde.org/plasma/kwin/-/wikis/Restarting

* main: verify that --wayland-fd is a valid file descriptor

* main: fail if only one of --socket and --wayland-fd is passed
2024-07-20 00:37:20 +02:00
13bc7e1e14 style: fix clang-format 2024-07-13 12:36:35 +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
cc98594c3a pointer: update geometry after unplug events
fixes #6700

fixes #6740
2024-07-05 23:05:09 +02:00
John Titor
315f16d501 dbus: import PATH XDG_DATA_DIRS variables into systemd and dbus session 2024-06-23 16:11:50 +03: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
c1e21719a2 core: avoid bumping hard rlimits, restore on fork
ref #6584
2024-06-19 18:36:40 +02:00
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
e0e3c4c6ae compositor: bump nofile rlimits on launch
ref #6584
2024-06-18 21:53:01 +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
18ee9ece9c layershell: minor fixes to re-mapping of layers
ref #2012
2024-06-12 22:57:06 +02:00
f687105eff compositor: update suspended states on moveworkspacetomonitor
fixes #6417
2024-06-12 16:02:25 +02:00
MightyPlaza
b6bf4afb48
layer: don't close special ws when restoring focus (#6424)
modified:   src/Compositor.cpp
modified:   src/Compositor.hpp
modified:   src/managers/input/InputManager.cpp
2024-06-11 22:56:35 +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
outfoxxed
90d0097716
input: fix input regions being ignored on ls-es (#6413) 2024-06-11 17:01:25 +02:00
722b846ac5 egl: assume implicit modifiers are available for old drivers
fixes #6367
2024-06-09 21:10:46 +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
Tom Englund
af5f24929d
core: free more memory on destruction (#6348)
* pointermgr: add destructor to state and free buf

if the pointer has a buffer set it wont be freed upon destruction, make
asan more happy by adding a destructor and wlr_buf_unlock it on exit.

* cursormgr: free the animation timer event source

properly free the animation timer event source on destruction.

* compositor: free the critsig event source on exit

properly free the critical signal event source on exit.

* popup: clang format style

clang format.
2024-06-06 20:27:09 +02:00
AERDU
506d0c06e6
compositor: change monitor focus when no_warps is enabled (#6260)
fixes focus between monitors when moving using directions with no_warps = true
2024-05-27 22:45:14 +02:00
Vaxry
addd3e7f1a
xwayland: move to hyprland impl (#6086) 2024-05-25 22:43:51 +02:00