Commit Graph

805 Commits

Author SHA1 Message Date
dbe2cb72f8
Allow floating views to appear at the mouse 2024-11-01 15:43:17 -07:00
2061ae2c4c
Merge branch 'master' of https://codeberg.org/river/river 2024-10-21 05:37:26 -07:00
Aviva Ruben
fd55f51ba1
input: support scroll button lock config 2024-10-03 11:42:21 +02:00
Isaac Freund
55974987b6
tearing-control: fix security-context related assert 2024-08-28 11:26:35 +02:00
Isaac Freund
f82b2f5816
tearing-control: minor cleanups/style improvements
This commit also tweaks the riverctl interface to make the global
allow-tearing option apply only to tearing-control-v1 hints from
clients. The global option no longer affects tearing/no-tearing rules
explicitly created by the user.
2024-08-15 11:49:51 +02:00
Violet Purcell
066baa5753
tearing-control-v1: implement
Implement the wp-tearing-control-v1 protocol allowing window to hint
the compositor that they prefer async "tearing" page flips.

Add tearing/no-tearing rules to allow the user to manually
enabled/disable tearing for a window.

Use async "tearing" page flips when a window that should be allowed to
tear is fullscreen.

This still requires several kernel patches to work with the wlroots
atomic DRM backend. For now, either set WLR_DRM_NO_ATOMIC=1 or use a
custom kernel that includes the unmerged patches (such as CachyOS).

Closes: https://codeberg.org/river/river/issues/1094
2024-08-15 11:45:53 +02:00
Isaac Freund
db7de8151c
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.
2024-08-07 11:09:38 +02:00
tiosgz
93863b132e Output: don't configure uninitialized layer surfaces
It is possible for a layer surface to notably delay its initial commit;
for example shotman[1] creates two layer surfaces and uses one of them
to get enough information for a screenshot and initializing the other.
River could also have sent a configure before initial commit if two
clients raced against each other.

Fixes https://codeberg.org/river/river/issues/1123

[1]:https://sr.ht/~whynothugo/shotman/
2024-07-26 07:53:42 +00:00
Isaac Freund
85a1673a9e
river: attempt to recover from GPU resets 2024-07-22 16:21:15 +02:00
Isaac Freund
2cc1d1cef3
LayerSurface: minor style/naming tweaks
No functional changes
2024-07-17 11:10:02 +02:00
tiosgz
f27bbf03f1 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.
2024-07-16 21:28:01 +00:00
Isaac Freund
99ef96a389
build: update to wlroots 0.18.0 2024-07-16 14:34:40 +02:00
Isaac Freund
a7411ef2a6
PointerConstraint: fix assertion failure
The assertion in PointerConstraint.confine() can currently still be
triggered if the input region of a surface is changed and the pointer is
moved outside of the new intersection of input region and constraint
region before PointerConstraint.updateState() is called.

This can happen, for example, when a client is made non-fullscreen at
the same time as the pointer is moved across the boundary of the new,
post-fullscreen, input region. If the pointer crosses the boundary
before the transaction completes and updateState() is called, the
assertion in PointerConstraint.confine() will fail.

To fix this, listen for the surface commit event rather than the
set_region event to handle possible deactivation on region changes.
2024-07-10 12:16:42 +02:00
14a5609dae
Merge branch 'master' of https://codeberg.org/river/river 2024-07-07 22:30:06 -07:00
Isaac Freund
4232d6b99f
layer-shell: fix on_demand keyboard focus
Currently keyboard focus is stolen from layer surfaces with
on_demand keyboard interactivity any time Root.applyPending() is called.

This commit fixes the behavior to only steal focus when explicitly
focusing a different window/layer surface.
2024-07-02 15:03:22 +02:00
Isaac Freund
ec16f1c375
XdgPopup: send configure after initial commit
Currently we send the first configure for xdg popups before the popup
has made its initial commit. This is incorrect according to the protocol
and may confuse clients.
2024-07-01 12:55:35 +02:00
Isaac Freund
a80e0f7322
Output: fix Wayland backend support
The wlroots Wayland backend does not support gamma LUT application and
will currently fail to render anything if river commits a gamma LUT.

To fix this, test the state when applying a gamma LUT and fall back to a
state with no gamma LUT set if that fails.

This problem was revealed by 2e09b66 which flags gamma as dirty on all
outputs when they are enabled.
2024-07-01 12:27:16 +02:00
Isaac Freund
ae7f4b8fcb
Xwayland: fix unsound cast
The X11 protocol uses 16 bit integers for width/height but we use
32 bit integers everywhere else in river. Make sure that values outside
the range of a 16 bit integer don't cause river to crash with an
assertion failure.

I think that coordinates outside the range of a 16 bit integer could
theoretically be reasonable with tiled high resolution displays in the
future. I doubt they ever get used in practice today but at the same
time we can't allow an errant layout generator to crash river.
2024-06-25 12:24:25 +02:00
Isaac Freund
2e09b66963
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.
2024-06-24 19:29:19 +02:00
ffb24267b8
Merge branch 'master' of https://codeberg.org/river/river 2024-06-19 13:28:50 -07:00
Isaac Freund
de3035563c
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.
2024-06-14 15:32:37 +02:00
Isaac Freund
28a14c6794
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.
2024-06-13 12:36:00 +02:00
fac47ffb5d
Merge branch 'master' of https://codeberg.org/river/river 2024-06-08 16:25:41 -07:00
Isaac Freund
8da69699e9
build: update to Zig 0.13.0 2024-06-07 14:01:30 +02:00
Isaac Freund
033cad47bf
build: update to Zig 0.12 2024-05-20 11:35:36 +02:00
Isaac Freund
680cb8ef69
PointerConstraint: remove overly tight assert 2
This is a second copy of the same assert that was removed in the last
commit. It should have been removed by that commit as well but was
overlooked.
2024-05-18 16:28:28 +02:00
Isaac Freund
5d1fc034bc
PointerConstraint: remove overly tight assert
This assert is incorrect if Xwayland is enabled and an Override Redirect
window steals the keyboard focus from the parent surface.

It also seems likely to be hit if a Wayland client attempts to use a
pointer constraint on a subsurface. I don't think a pointer constraint
on a subsurface is likely to work entirely correctly and I don't know of
any Wayland clients that try such a thing. We can't let them crash river
by trying though.
2024-05-18 14:40:20 +02:00
Isaac Freund
c75d32c88b
InputPopup: fix minor issues, simplify code 2024-05-16 11:40:41 +02:00
ed9e9c4d16
Remove assert that was causing crashes 2024-05-16 00:55:37 -07:00
930dcb7dcd
Fix current view tags status 2024-05-15 19:20:48 -07:00
929db0098a
Merge branch 'master' of https://codeberg.org/river/river 2024-05-15 04:36:26 -07:00
Isaac Freund
b35a40b9df
TextInput: ignore enable requests without focus 2024-05-15 12:21:22 +02:00
Isaac Freund
ba6023e38a
InputPopup: fix naming 2024-05-15 11:50:58 +02:00
leviathan
74baf7225a
input-method-v2: Implement popups 2024-05-15 11:23:41 +02:00
Isaac Freund
b5a80c7b9b
Server: fix filtering of newly created globals
Fixes: https://codeberg.org/river/river/issues/1068
2024-05-15 09:48:55 +02:00
ymcx
bed50f0dd2
command/swap: fix cursor warp on focus change 2024-05-14 23:37:10 +02:00
Isaac Freund
1e3ef88bd5
Keyboard: fix redundant leave/enter on creation
Currently if a second keyboard input device is created river will send
a wl_keyboard.leave event immediately followed by a wl_keyboard.enter
event. This serves no purpose and can confuse clients, in particular due
to fctix creating/destroying virtual keyboards on focus change.

Fixes: https://codeberg.org/river/river/issues/1062
References: https://github.com/fcitx/fcitx5/issues/1044
2024-05-12 16:16:04 +02:00
Isaac Freund
f66eec9248
Cursor: don't hide while pointer constraint active
Fixes: https://codeberg.org/river/river/issues/1053
2024-05-12 10:42:19 +02:00
16d76ae86c
Add tags field to focused_view event 2024-05-03 03:02:41 -07:00
LordMZTE
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
Alex Mirrlees-Black
5262a4c5a6 input: change ScrollFactor and MapToOutput to align with other options 2024-04-24 23:59:54 +10:00
Alex Mirrlees-Black
bd5da261eb input: fix scroll-factor resetting if unspecified 2024-04-23 23:28:42 +10:00
Alex Mirrlees-Black
5fbf174c36 input: prevent duplicate input configs 2024-04-23 22:38:18 +10:00
Isaac Freund
9bbd34a0e3
XdgToplevel: update clip on geometry x/y change
Currently if a client commits a geometry with a different x/y value but
does not change the width/height we might not update the clip
coordinates of the surface tree, potentially causing part of the surface
to be unintentionally clipped off.

To fix this, check for change in geometry x/y as well as width/height on
commit if the client is not currently part of an ongoing transaction.

Firefox for example it seems may respond to a configure non-atomically
with multiple commits:

1. commit new buffer and new geometry of a new width/height.
2. commit again with the same width/height but a new geometry x/y.

I don't think this is technically a bug but it doesn't seem like the
most efficient way to do things. I think this may also cause imperfect
frames. In any case, this should no longer cause river to crop off part
of firefox's surface.
2024-04-19 13:46:08 +02:00
Isaac Freund
d1dc873408
XdgToplevel: don't update geometry if configure inflight 2024-04-18 10:48:59 +02:00
Isaac Freund
df5cb5dfe8
input: minor fixes and cleanups for scroll-factor 2024-04-16 13:26:01 +02:00
István Donkó
8a3018a311
input: add scroll-factor configuration 2024-04-16 13:25:40 +02:00
Isaac Freund
4a019142be
layer-surface: close if exclusive zones too large
It seems layer-shell clients such as waybar can commit bogus exclusive
zones larger than the width/height of the output. While this client
behavior is questionable at best, it must not cause river to crash or
otherwise misbehave.

Therefore, close layer surfaces causing the usable (not exclusive zone)
area of an output to be reduced below half of the width/height.
2024-04-16 12:18:39 +02:00
Isaac Freund
3e306ecfbf
river: raise the file descriptor limit 2024-04-08 16:24:51 +02:00
Isaac Freund
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