Commit Graph

164 Commits

Author SHA1 Message Date
0c095f0c93 Merge branch '0.3.x' of https://codeberg.org/river/river 2025-06-29 19:31:25 +09:00
15736c57d7 linux-dmabuf: re-enable per-surface feedback
This was disabled due to being too spammy in the past. Since wlr_scene
now debounces per-surface feedback it should be fine to re-enable this.
2025-06-18 12:22:17 +02:00
037314823e build: update to wlroots 0.19 2025-06-18 12:22:17 +02:00
993bdf96d1 Root: simplify scene tree reparenting
Making these reparent() calls unconditional avoids inconsistent state.
It's also simpler and less error-prone and the wlroots function returns
immediately if the parent doesn't change anyways.

(cherry picked from commit db7de8151c)
2024-12-09 14:49:55 +01:00
eb32deaf76 build: update to wlroots 0.18.0
(cherry picked from commit 99ef96a389)
2024-07-22 17:19:44 +02:00
b85da67886 Output: flag gamma as dirty on enable
We can end up with stale gamma settings if we don't re-check the
current gamma settings for the output on enable.

(cherry picked from commit 2e09b66963)
2024-07-10 12:28:57 +02:00
99b31c39f3 input: apply map-to-output on output activation
Currently a map-to-output input config setting loses effect when an
output is disabled and re-enabled for example.

(cherry picked from commit de3035563c)
2024-07-10 12:28:49 +02:00
312465e0cb build: update to Zig 0.12
(cherry picked from commit 033cad47bf)
2024-05-20 12:07:52 +02:00
930dcb7dcd Fix current view tags status 2024-05-15 19:20:48 -07:00
e29d66f1de Xwayland: disallow negative output coordinates
Xwayland clients on outputs at negative positions don't currently
receive mouse events due to a bug in Xwayland. As a workaround, we
disallow negative output positions when Xwayland is enabled.

References: https://gitlab.freedesktop.org/xorg/xserver/-/issues/899
Closes: #1058
2024-05-02 14:08:34 +02:00
94828474b0 View: add more assertions around destruction
This should make leaks like the one fixed by the previous commit harder
to write.
2024-04-08 15:19:12 +02:00
a374c6ab84 Root: fix leak on view destroy
This leaks memory and possibly an fd currently whenever a view is
destroyed.
2024-04-08 15:02:55 +02:00
b0e54c6396 Output: fix possible assertion failure on enable
Currently if we disable an output due to a wlr-output-power-management
protocol request we do not update Output.lock_render_state properly.

This is fine if the output is also re-enabled using the
wlr-output-power-management protocol but causes an assertion failure
if it is re-enabled using wlr-output-management instead.
2024-04-08 13:34:47 +02:00
f3cd98288a Root: increase transaction timeout to 100ms
This was dropped from 200ms to 50ms in 4a65af66. However 50ms seems
to be a bit too short in practice. I often hit ugly frame imperfection
do to timeouts when toggling mpv between a small floating window and
fullscreen for example, even on a relatively beefy desktop computer.

This only happens while the video is playing in mpv, not while it is
paused. I believe this is due to mpv ignoring the compositor's hints for
when to render a new frame entirely while playing a video. It instead
renders at the framerate of the video being played, even if the
compositor requests a change in size. This isn't great but seems
unlikely to change [1].

Overall, hitting 100ms timeouts subjectively doesn't feel anywhere near
as sluggish as hitting 200ms timeouts and offers better frame perfection
than 50ms timeouts in at least this one example, there are bound to be
others.

[1]: https://dudemanguy.github.io/blog/posts/2022-06-10-wayland-xorg/wayland-xorg.html
2024-03-17 22:55:43 +01:00
1b63c463a7 security-context: implement protocol
Sensitive Wayland protocols such as wlr_screencopy and wlr_data_control
(clipboard managment) are now blocked by default inside security
contexts (e.g. flatpak 1.15.6 or later).

User configuration of the allowlist/blocklist is TODO.
2024-03-15 14:47:43 +01:00
b65e4f6b17 idle-inhibit: fix naming, eliminate "self" naming convention
Also add missing copyright headers
2024-03-14 12:51:34 +01:00
693a2b0dda XwaylandOverrideRedirect: eliminate "self" naming convention 2024-03-14 12:29:49 +01:00
8a9b07ae4b Root: eliminate "self" naming convention 2024-03-14 12:04:15 +01:00
4e48d68485 View: restore to previous output on reconnect 2024-03-14 11:07:15 +01:00
c474be1537 build: require wlroots version 0.17.2
This fixes a crash that users have hit fairly often in the wild using
Xwayland and allows us to remove an ugly workaround for another issue.
2024-03-11 19:14:37 +01:00
4a65af667e Root: reduce transaction timeout to 50ms
The current value of 200ms is too long and makes river feel very slow
when it it hit due to an application being very slow/frozen.

The new timeout of 50ms seems to be rarely hit in practice even on
slower hardware such as my old Thinkpad x220. When it is hit the system
feels much more responsive than when the 200ms timeout is hitdespite the
guilty application window potentially being visible in the wrong
location/size a bit longer.
2024-03-08 12:21:02 +01:00
12e6833f31 linux-dmabuf: disable per-surface feedback
It seems like the wlr_scene implementation of sending per-surface
feedback is a bit too spammy and can lead to resource exhaustion in
clients in at least some reported cases.
2024-02-27 17:10:27 +01:00
0605ce507e Root: fix auto-layout output coordinates
Outputs using the wlr_output_layout auto-layout feature may have their
coordinates update any time an output is added/removed to the layout or
the position of another output in the layout is set.

River currently doesn't keep the scene node coordinates of such outputs
in sync with their position in the output layout, which leads to bugs
with e.g. the cursor not working properly for such outputs.
2024-02-25 14:37:34 +01:00
60b06a6741 output-management: fix output destroy handling
Currently we update output-management clients based on changes in the
wlr_output_layout struct. However, this is obviously wrong on closer
inspection due to the fact that not all outputs are tracked by the
wlr_output_layout at all times. I think this aproach was originally
cargo-culted from some other output-management implementation and it
needs to go.

Luckily, the solution is quite simple since the only way to configure
outputs using river is through the wlr-output-management protocol. This
means we need to send a new configuration to the output-management
client in 3 cases:

1. An output is created
2. An output is destroyed
3. A wlr-output-management config from a client is applied
2024-02-25 13:42:58 +01:00
0cb7c49cc3 command/input: add map-to-output 2024-02-23 12:22:42 +01:00
53c09be846 Root: fix crash on deinit() 2024-02-20 23:14:12 +01:00
a04c18819b Root: fix crash on output disable
If there is a transaction inflight when an output is disabled then we
must call View.commitTransaction() for any views evacuated from the
disabled output to ensure transaction state remains consistent.

Root.commitTransaction() will not call View.commitTransaction()
for these evacuated views as their output is no longer around.
2024-02-20 23:14:12 +01:00
bf7b9d15dd Root: trival code cleanup in deactivateOutput() 2024-02-19 23:21:08 +01:00
a531311ac6 XdgToplevel: handle configure timeout gracefully
Currently configure timeouts hit the "client is buggy and initiated size
change while tiled or fullscreen" code path even if the client is not in
fact buggy. This causes state to get out of sync between river and the
client, and is highly visible as the borders drawn by river no longer
align with the buffer dimensions committed by the client.

This commit fixes this by tracking acks/commits in response to
configures even after a timeout and properly integrating them with the
transaction system.
2024-02-13 14:50:58 +01:00
6e9bd83e1d Root: use Output.PendingState for fallback
Using the same type for these has the potential to simplify some future
code.
2024-01-12 16:49:04 -06:00
cc1f988e56 Root: fix stack order on restore from 0 outputs 2024-01-09 13:11:16 -06:00
c38e7e2d87 Root: remove unneeded fallback.inflight lists 2024-01-09 13:03:55 -06:00
9aa0f1a9a6 Output: fix possible crash on destroy 2024-01-05 12:50:36 -06:00
28dcd8320a linux-dmabuf: send better per-surface feedback
This commit leverages the new wlr_scene helper to send custom feedback
per surface rather than using the same default feedback for every
surface. This should allow direct scanout to work more reliably with
multiple outputs for example.
2024-01-03 17:23:53 -06:00
a128a574a4 output-management: work around wlroots crash 2024-01-01 22:52:25 -06:00
5f0c9e2ccf output-management: fix output config application
Currently wlr-output-management config application is broken since the
pre 0.17 code relied on the (now removed) output enable/disable event to
be emitted as part of the state application.

The old code was pretty smelly and hard to understand, I'm glad the
upstream improvements pushed river's code in this directions.
2024-01-01 22:52:25 -06:00
b440767b54 gamma-control: track wlroots 0.17 changes 2023-12-29 16:22:15 -06:00
d207e08dab Root: fix faulty assertion, cleanup
Thanks to tiosgz for prompting me to look at this more closely.

There doesn't seem to be any compelling reason to use the
wlr_scene_output_layout helper, it's simpler to just make the two
necessary SceneOutput.setPosition() calls manually. This will hopefully
be refactored down to a single call eventually as well.
2023-12-05 10:32:30 +01:00
7ee6c79b6b build: update to wlroots 0.17 2023-12-01 17:29:05 +01:00
69b61602cf View: handle map while no outputs are available
Currently views which are mapped while no outputs are available can
never actually get rendered because they have 0 tags and are stuck in
the hidden stack.

This commit fixes this and they should now be restored when a new output
becomes available.
2023-11-09 16:36:39 +01:00
2e586c7061 build: update to Zig 0.11.0 2023-10-16 16:27:03 +02:00
0cc930b738 Root: fix inflight_layout_demands counting
Not decreasing the counter caused a weird bug where disabling/removing
an output (curiously, it seems to apply only to last active output being
removed) would lock the user out of the session, not letting the
transaction to complete (therefore hiding all views on a newly added
output) and messing up focus.

Fixes https://github.com/riverwm/river/issues/830
2023-08-13 11:22:28 +00:00
4726a6b0f1 Root: migrate {all,active}_outputs to wl.list
As discussed with ifreund on irc. This avoids extra allocation in case
of all_outputs and confusion in case of active_outputs (because with the
Output embedded in the Node, i thought its value was copied instead of
its pointer).
2023-08-13 11:10:46 +00:00
8966f95e72 Root: make 'fallback output empty' assertion stricter 2023-08-13 11:06:57 +00:00
57186fced3 Root: rename field outputs to active_outputs
Although this list only including active outputs was already documented,
making this explicit in its name reduces confusion and debugging
overhead.
2023-08-13 11:06:25 +00:00
bbd21c1637 river: update some comments
Mostly stuff not reflecting renames, plus a few if-then comma errors i
noticed.
2023-08-03 10:52:16 +00:00
c2ce893dd0 Cursor: apply x/y change during resize on commit
This fixes issues with resizing clients that stick to a fixed aspect
ratio during resize such as mpv.
2023-03-15 17:33:16 +01:00
a679743fa0 Cursor: lock to current geometry during move/resize
This eliminates cursor jitter entirely during interactive resize.

This also fixes a bug where the xdg-toplevel resizing state was not
cleared if a resize operation was aborted due to a change in view tags
or similar.
2023-03-14 13:34:55 +01:00
0ba65848a1 Root: separate fallback list to handle 0 outputs
Mixing views that are currently being mapped/unmapped with views that
are stashed during hotplug down to 0 outputs is error-prone and almost
certainly has a bug or two hiding currently.
2023-03-14 11:53:04 +01:00
95825b0153 Root: remove incorrect assertions in addOutput() 2023-03-14 11:41:02 +01:00