Commit Graph

55 Commits

Author SHA1 Message Date
f0c7f57d36 LayerSurface: fix crash on bad exclusive zone
River closes layer surfaces with an unreasonably large exclusive zone.
However, due to unfortunate/awkward code structure, this currently
may cause a use-after-free on mapping layer surface.
2025-09-01 09:55:49 +02:00
88a8c45ac0 river: run 0.15 zig fmt 2025-08-22 15:11:50 +02:00
d72408df18 build: update to Zig 0.15 2025-08-22 15:09:07 +02:00
40294223d4 LayerSurface: drop new_popup link in handleDestroy()
This fixes an assertion in wlroots:

    river: types/wlr_layer_shell_v1.c:55: layer_surface_destroy: Assertion `wl_list_empty(&surface->events.new_popup.listener_list)' failed.
2025-06-18 12:22:17 +02:00
037314823e build: update to wlroots 0.19 2025-06-18 12:22:17 +02:00
62576d792c LayerSurface: minor style/naming tweaks
No functional changes

(cherry picked from commit 2cc1d1cef3)
2024-07-22 17:20:02 +02:00
2a75d51eec LayerSurface: focus on_demand-interactive surfaces on map
This is done specifically for lxqt-runner and qterminal to work as
expected, consistently among (almost) all compositors with layer-shell.
The most prominent drawback of this is that top- and overlay-layer
status bars with on_demand interactivity also get focus on map.

See https://codeberg.org/river/river/issues/1111 for more details.

(cherry picked from commit f27bbf03f1)
2024-07-22 17:19:59 +02:00
eb32deaf76 build: update to wlroots 0.18.0
(cherry picked from commit 99ef96a389)
2024-07-22 17:19:44 +02:00
36cdbbc087 SceneNodeData: fix fromSurface() use after free
We must clean up the user data of the wlr_surface for layer surfaces and
lock surfaces as fromSurface() may be called (e.g. by the idle inhibit
implementation) after the scene node has been destroyed but before the
wlr_surface is destroyed.

(cherry picked from commit 28a14c6794)
2024-07-10 12:28:44 +02:00
312465e0cb build: update to Zig 0.12
(cherry picked from commit 033cad47bf)
2024-05-20 12:07:52 +02:00
7ee6c79b6b build: update to wlroots 0.17 2023-12-01 17:29:05 +01:00
2e586c7061 build: update to Zig 0.11.0 2023-10-16 16:27:03 +02:00
eaa2f6d37e LayerSurface: fix surfaces on multiple outputs at once
The previous commit broke handling of keyboard interactive
layer surfaces being created on multiple outputs at once.

This new approach reverts part of the logic change in the previous
commit while keeping the fix for the crash and the new assertion.
2023-03-16 15:10:52 +01:00
133b88c266 LayerSurface: handle focus when switching outputs
Currently if a layer surface is focused and the user focuses a different
output the layer surface remains focused. However, updating focus on
layer surface unmap only considers seats that have the layer surface's
output focused.

To fix this there are 3 approaches I see:

1. Unfocus all layer surfaces on the old output when switching output
focus, focus any layer surfaces on the new output.

2. Disallow switching output focus while a layer surface is focused.

3. Stop caring about output focus when determining which layer surface
should gain/lose focus.

I've taken the 3rd option here as it is significantly simpler to
implement and maintain but still feels reasonably intuitive.
2023-03-16 11:03:33 +01:00
44004e2d28 SceneNodeData: allow access from wlr_surfaces
This replaces the old View.fromWlrSurface function and is more general.

This commit also moves the xdg activation request_activate listener to
Server as it has no reason to be in View.
2023-03-04 22:41:35 +01:00
f5f9b526a0 river: fix a few leaks 2023-03-04 20:12:37 +01:00
6411c71151 Root: centralize focus(null) calls in applyPending() 2023-03-01 10:49:44 +01:00
e11d4dc0de LayerSurface: fix use-after-free on destroy
The scene_layer_surface may be destroyed before handleDestroy is called,
which means we can't rely on it to access the wlr_layer_surface in
destroyPopups().
2023-02-28 18:28:17 +01:00
be4330288d river: rework core data structures & transactions 2023-02-28 18:28:17 +01:00
879b880a6a XdgPopup: reimplement using the scene graph
xdg-shell version 3 is now implemented, supporting popup repositioning.
2023-02-28 14:55:58 +01:00
dbcb75dddb LayerSurface: render using the scene graph
This also brings a lot of code cleanup and proper support for
version 4 of the protocol.
2023-02-28 14:55:58 +01:00
f4a8d6dcc9 Output: use separate scene trees for layers 2023-02-28 14:55:58 +01:00
168756cbe8 render: remove damage tracking
This will be handled by wlr_scene shortly.
2023-02-28 14:55:58 +01:00
09f3f141ae deps: update to Zig 0.10 2023-01-08 16:21:42 +01:00
49efbfe046 session-lock: handle output unplugging better 2022-11-13 16:45:18 +01:00
489a49735a river: update to wlroots 0.16 2022-11-13 16:16:07 +01:00
c0e64829f0 layer-shell: start transaction on map
The fact that this call is missing is a bug, as the changes made by
arranging the output layers as well as changes to the focus will not be
fully applied.
2022-08-25 13:24:42 +02:00
79d7775a3d code: relicense to GPL-3.0-only
I don't need anyone's permission to make this change since
GPL-3.0-or-later is one-way compatible with GPL-3.0-only.
2022-01-31 19:33:22 +01:00
c1d985ac29 build: update to zig version 0.9.0 2021-12-24 05:28:14 +00:00
c34d850397 layer-shell: fix regression from wlroots 0.15 update
The way wlroots handles the layer surface configure flow has changed a
bit and river's logic needs updating.
2021-12-21 19:41:47 +00:00
4d19621f1e river: update to wlroots 0.15.0 2021-12-21 03:18:30 +00:00
1e18ac9d74 layer-shell: ignore commits on closed layer surface 2021-08-12 21:18:26 +02:00
863f8156f7 river: properly teardown surface tree
When an xdg toplevel, layer surface, etc is destroyed, it is not
guaranteed that all the children in the surface tree have already been
destroyed. If there are still children around, destroying the root of
the tree would leave dangling pointers.

To fix this, destroy all children when destroying any node in the tree.
2021-07-28 13:44:23 +02:00
41874b47ae code: update to wlroots 0.14.0 2021-06-23 15:35:10 +02:00
3efcfedcf4 layer-shell: handle commits before map
A client is free to change its mind and request a different
size/anchor/etc after recieving the initial configure but before
attaching and committing the first buffer. This means that we should
respond to such a situation with a new configure.

mako has been observed doing this in the wild for example.
2021-06-22 14:07:14 +02:00
0e9dc089d1 render: track subsurfaces created before role assignment 2021-06-05 19:30:43 +00:00
c0a2286847 code: update to zig 0.8.0 2021-06-05 17:29:58 +00:00
13f01bcb4b render: do basic yes/no damage tracking 2021-05-24 16:43:21 +02:00
ac27db236a river: remove Output.root
The server is now global so this is no longer needed.
2021-05-13 14:35:36 +02:00
89e0d4c083 river: remove Root.server
The server is now global so this is no longer needed.
2021-05-13 14:26:27 +02:00
98d51f6d24 Use std.log instead of log.zig 2021-02-08 18:35:11 +01:00
cc08be2dee code: clean up listener initialization 2020-12-31 15:35:35 +01:00
20d804cdb5 code: switch to custom wlroots/libwayland bindings
This is a big step up over @cImport() for ergonomics and type safety.
Nearly all void pointer casts have been eliminated!
2020-12-13 22:53:33 +01:00
f80992e329 meta: make copyright headers more maintainable
- list all files as copyright "The River Developers"
- add an AUTHORS file to acknowledge contributors
2020-11-11 20:33:43 +01:00
a90ddd305b code: use zig 0.7.0 and wlroots 0.12.0 2020-11-10 11:46:03 +01:00
37ea1bac36 layer-surface: clean up initialization 2020-08-21 16:53:04 +02:00
aabd85b028 layer-shell: improve configure handling
- don't send a new configure on commit if nothing has changed
- simplify code
2020-08-13 11:17:15 +02:00
7a6ac8eb6e seat: set focus before starting transactions
Focus was made double-buffered in 96a91fd. However, much of the code
still behaved as if focus was separate from the transaction system.
This commit completes the work started in 96a91fd and ensures that
focus is applied consistently in a single transaction.
2020-08-13 11:17:15 +02:00
101f47d78f code: use a tagged union to store focus
This simplifies the code and is more robust than two separate pointers.
2020-07-15 14:15:17 +02:00
341fe1e977 code: handle out of memory as well as possible 2020-07-05 22:49:17 +02:00