776 Commits

Author SHA1 Message Date
Isaac Freund
312465e0cb
build: update to Zig 0.12
(cherry picked from commit 033cad47bf63f2914865c19fc10b4dc991007515)
2024-05-20 12:07:52 +02:00
Isaac Freund
a019045a16
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.

(cherry picked from commit 680cb8ef699f89cd7ce0b613221e073b534c22c5)
2024-05-18 17:07:48 +02:00
Isaac Freund
7b42c38276
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.

(cherry picked from commit 5d1fc034bc6aedc340671d5de76add308effd2e8)
2024-05-18 17:07:48 +02:00
Isaac Freund
fa077d31b4
InputPopup: fix minor issues, simplify code
(cherry picked from commit c75d32c88b2fda71b543b72e02117cdfb7693e2e)
2024-05-18 13:41:28 +02:00
Isaac Freund
cc5a249e9e
TextInput: ignore enable requests without focus
(cherry picked from commit b35a40b9dfa3e70dbdc11e8383c584164b475420)
2024-05-18 13:41:28 +02:00
Isaac Freund
84ec97aff2
InputPopup: fix naming
(cherry picked from commit ba6023e38a965d80788a3de33d6c19968db03647)
2024-05-18 13:41:28 +02:00
leviathan
7db9ade574
input-method-v2: Implement popups
(cherry picked from commit 74baf7225ad95f8288f5dc1fe50345425cd62f71)
2024-05-18 13:41:28 +02:00
Isaac Freund
9c56eb051f
Server: fix filtering of newly created globals
Fixes: https://codeberg.org/river/river/issues/1068
(cherry picked from commit b5a80c7b9b34a42b2546d8724498b0b6d59f6cec)
2024-05-18 13:41:28 +02:00
ymcx
9b0e90cdb4
command/swap: fix cursor warp on focus change
(cherry picked from commit bed50f0dd2099e06c85f0fd0cc3bbdb10f3c9353)
2024-05-18 13:41:28 +02:00
Isaac Freund
cfb67b9e7a
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
(cherry picked from commit 1e3ef88bd573e4940f7e9dcffdbf119161473e4d)
2024-05-18 13:41:05 +02:00
Isaac Freund
717894b007
Cursor: don't hide while pointer constraint active
Fixes: https://codeberg.org/river/river/issues/1053
(cherry picked from commit f66eec92482dabb782d5457caef4ca1dbfb82b59)
2024-05-18 13:30:59 +02:00
Alex Mirrlees-Black
442913fa82
input: change ScrollFactor and MapToOutput to align with other options
(cherry picked from commit 5262a4c5a61f547acd29560f1af9cf342b9958ae)
2024-04-27 13:39:47 +02:00
Alex Mirrlees-Black
b5964d7f1f
input: fix scroll-factor resetting if unspecified
(cherry picked from commit bd5da261eb584fd40e0b1e1609d7db5faa0ae517)
2024-04-27 13:39:47 +02:00
Alex Mirrlees-Black
33cc85d5ef
input: prevent duplicate input configs
(cherry picked from commit 5fbf174c3644a64ee217c732190b16ab9b65120a)
2024-04-27 13:39:47 +02:00
Isaac Freund
b2c4d38e09
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.

(cherry picked from commit 9bbd34a0e31b6d429df2d39a59d8990a9585e186)
2024-04-27 13:39:47 +02:00
Isaac Freund
dbfaa05a67
XdgToplevel: don't update geometry if configure inflight
(cherry picked from commit d1dc873408d2b45c53dfc174ad0eadfe15a2355e)
2024-04-27 13:39:47 +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
Isaac Freund
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
Isaac Freund
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
Isaac Freund
3594fe501e
View: fix assertion failure if focused while destroying
Also clean up this code a bit, it's no longer necessary to split these
one line functions out into separate files as Zig's conditional
compilation support has improved since these functions were originally
written.
2024-04-08 12:54:05 +02:00
Isaac Freund
36d8e90a54
View: always check if current.output is null
This field being nullable at all is code smell. I think what needs to
happen here long term is for a proper separation of "window management
output" and "physical output" as concepts and integration outputs into
the transaction system.

That's a much larger change and I don't want to cause that amount of
code churn just before a release though.
2024-04-03 17:18:54 +02:00
tiosgz
198351794b
Keyboard: ignore multiple presses of a key
I have managed to crash river (because the relevant assertion was wrong)
on this using fcitx5 (5.1.8) and anthy with the following sequence of
key events on a physical keyboard (every line followed by releasing
everything):
    super-; (my shortcut to enable anthy)
    shift-letter (fcitx doesn't release shift on its virtual keyboard)
    escape
    shift (fcitx sends another press event)
The failure to release shift is not the only weirdness happening, but
it's what eventually lead to the assertion failure.
2024-03-26 10:48:28 +01:00
Isaac Freund
12de175e11
command/map: add note about upstream xkbcommon fix 2024-03-24 11:46:07 +01:00
Leon Henrik Plickat
b77b42f0d6
command/focus-view: add -skip-floating 2024-03-22 12:37:18 +01:00
Isaac Freund
6491310e12
layer-shell: crop surfaces to output bounds 2024-03-20 13:23:36 +01:00
Isaac Freund
13b9d23e2f
View: fix potential assertion failure on destroy
If a View is destroyed while part of a transaction we can currently hit
an assertion failure, this commit fixes it.
2024-03-18 22:33:24 +01:00
Leon Henrik Plickat
3473d6c0be
TabletTool: use "pencil" cursor shape
This makes tablet tool cursors visually distinct from pointer cursors by
default. Client may of course continue to set custom cursors for tablet
tools if they have focus.

Also fixes a custom cursor set by a client persisting after the tablet
exits the client's surface until proximity out.
2024-03-18 20:43:59 +01:00
Isaac Freund
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
Isaac Freund
3f49ff9631
deps: update zig-wayland for a minor cleanup 2024-03-15 19:10:18 +01:00
Isaac Freund
d64cbd2100
touch: handle cancel event, fix assertion failure
Currently we can hit an assertion failure in the putNoClobber() call in
response to the down event since we fail to handle the cancel event.

This commit fixes that issue.
2024-03-15 19:08:10 +01:00
Isaac Freund
0e7a692831
XdgToplevel: validate move/resize request serial
Currently we only support interactive move/resize with the pointer,
touch and tablet tool support are TODO.

Validate the serial here to ensure we don't start a pointer move/resize
in response to the client attempting to start a move/resize with
touch/tablet tool.

This fixes an assertion failure that the pointer's cursor is not hidden
during move/resize, which is how the issue was discovered. Another win
for assertions :)
2024-03-15 15:24:46 +01:00
Isaac Freund
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
Isaac Freund
e143cdeca9
pointer-gestures: move to input manager
We definitely should not create duplicates of the global for each seat.

Not that we really support multi-seat yet, but someday.
2024-03-15 13:25:02 +01:00
Isaac Freund
451387a4a9
Server: remove all listeners on deinit() 2024-03-14 13:42:14 +01:00
Isaac Freund
388c95d2e9
RuleList: eliminate "self" naming convention 2024-03-14 13:07:58 +01:00
Isaac Freund
8764b82da5
Vector: eliminate "self" naming convention 2024-03-14 13:06:29 +01:00
Isaac Freund
37d9d6e725
Switch: eliminate "self" naming convention 2024-03-14 13:04:41 +01:00
Isaac Freund
0131d4670d
SwitchMapping: eliminate "self" naming convention 2024-03-14 13:02:38 +01:00
Isaac Freund
82a40725f9
Control: eliminate "self" naming convention 2024-03-14 13:01:49 +01:00
Isaac Freund
3077074329
Mode: eliminate "self" naming convention 2024-03-14 13:00:15 +01:00
Isaac Freund
b9dde3c49b
LayoutDemand: eliminate "self" naming convention 2024-03-14 12:59:42 +01:00
Isaac Freund
c3cee0b91f
PointerMapping: eliminate "self" naming convention 2024-03-14 12:58:50 +01:00
Isaac Freund
278865065b
StatusManager: eliminate "self" naming convention 2024-03-14 12:57:23 +01:00
Isaac Freund
1d8bca24ae
SeatStatus: eliminate "self" naming convention 2024-03-14 12:55:54 +01:00
Isaac Freund
4a259d322b
InputConfig: eliminate "self" naming convention 2024-03-14 12:53:09 +01:00
Isaac Freund
b65e4f6b17
idle-inhibit: fix naming, eliminate "self" naming convention
Also add missing copyright headers
2024-03-14 12:51:34 +01:00