Commit Graph
100 Commits
Author SHA1 Message Date
Isaac Freund f9201ae7cd ci: re-enable FreeBSD builds
Official FreeBSD zig tarballs have returned!

This reverts commit 7fdba05b82.
2024-06-13 11:32:38 +02:00
Isaac Freund 16c938111d ci: use mirror for zig tarball downloads
Eat Github's resources rather than the Zig Software Foundation's
resources!
2024-06-13 11:16:47 +02:00
Isaac Freund 8da69699e9 build: update to Zig 0.13.0 2024-06-07 14:01:30 +02:00
Isaac Freund c5b1d1de4e ci: cleanup messy tar invocations 2024-05-23 16:21:02 +02:00
Isaac Freund 7fdba05b82 ci: drop FreeBSD CI for now
There is no FreeBSD tarball from ziglang.org and FreeBSD itself has not
yet updated their Zig package to 0.12.0. This commit should be reverted
when a good way is found to obtain Zig 0.12.0 for the FreeBSD CI.
2024-05-20 11:45:09 +02:00
Isaac Freund 958f8798b6 build: switch to the Zig package manager
No more git submodules!
2024-05-20 11:44:08 +02:00
Isaac Freund 045ee7bd25 build: add -Dno-llvm build option 2024-05-20 11:35:36 +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
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
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
Isaac Freund ad0b71c310 github: automatically close prs 2024-05-14 13:02:29 +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
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 6b86af4f85 build: bump version to 0.4.0-dev 2024-04-17 14:39:55 +02:00
Isaac Freund d3178ae13f build: bump version to 0.3.0 2024-04-16 14:03:17 +02:00
Isaac Freund f9e52f32bf docs: remove website url at top of readme
Codeberg lets me put this by the repository description.
2024-04-16 13:51:46 +02:00
Isaac Freund 6bae8efe01 docs: freshen up readme with text from website 2024-04-16 13:48:39 +02:00
Isaac Freund df5cb5dfe8 input: minor fixes and cleanups for scroll-factor 2024-04-16 13:26:01 +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 70ad2af8f4 docs: update URL in man pages
Also remove the redundant URL in the footer and the redundant
"General Commands Manual" text (scdoc adds that by default based on the
section it seems).
2024-04-15 11:23:05 +02:00
Isaac Freund 14e941bae1 docs: redefine Code of Conduct scope 2024-04-09 14:18:47 +02:00
Isaac Freund 86d142aa47 logo: make readme logo bigger on small displays
The correct way to do this would be to use the max-width css attribute,
but codeberg seems to strip that when converting markdown to html.

The new value of 600em looks almost identical to 50% on large screens
and looks a lot better on small (mobile) screens.
2024-04-09 10:41:34 +02:00
Isaac Freund 7974bfdb7d docs: fix another broken link in the coc
The markdown generation of the upstream Contributor Covenant page seems
to have some issues.
2024-04-09 09:43:02 +02:00
Isaac Freund 9a04462cdf docs: fix broken link in coc 2024-04-09 09:41:38 +02:00
Isaac Freund 06c13197bb docs: add Code of Conduct 2024-04-09 08:57:17 +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 93f9eb8e5e logo: use adaptive color/no background for readme
This looks nicer with dark themes. Light themes should be effectively
unchanged.
2024-04-08 12:28:46 +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
Isaac Freund 8b8ac27c45 ci: migrate to codeberg 2024-04-01 22:28:23 +02:00
Isaac Freund 8d59622ae1 docs: fix typo in previous commit 2024-03-26 15:23:49 +01:00
Isaac Freund 1946f284d5 docs: update README stability disclaimer 2024-03-26 15:16:49 +01:00
Isaac Freund c4877de3ca logo: add an official river logo
This logo is based on original raster images designed by Karl Felix
Schewe (@kardwen on codeberg/github). I created a modified svg version
from scratch in inkscape. I've included several variations (with text,
with text and a background) for various use cases.

The versions with text use the Dongle font [1] which is released under
the OFL and therefore free for us to use in the logo without
acknowledgement according to [2].

[1]: https://github.com/yangheeryu/Dongle
[2]: https://openfontlicense.org
2024-03-26 13:24:53 +01:00
Isaac Freund 7ceed0d093 docs: update release urls for codeberg migration 2024-03-25 20:12:29 +01:00
Isaac Freund 4d0315b565 docs: update wiki url 2024-03-25 19:56:46 +01:00
Isaac Freund 19133422c1 codeberg: maybe fix issue template take 2 2024-03-25 19:45:52 +01:00
Isaac Freund 4efeb2a278 codeberg: maybe fix issue template 2024-03-25 19:43:26 +01:00
Isaac Freund b106466ad9 codeberg: add bug report issue template 2024-03-25 19:37:53 +01:00
Isaac Freund 12de175e11 command/map: add note about upstream xkbcommon fix 2024-03-24 11:46:07 +01:00
Isaac Freund ed99d7bc14 docs: migrate to codeberg
wiki and release migration are TODO
2024-03-22 16:49:28 +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
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
Isaac Freund b0d4610999 LayoutManager: eliminate "self" naming convention 2024-03-14 12:40:26 +01:00
Isaac Freund b7c53ceda7 Config: eliminate "self" naming convention 2024-03-14 12:40:13 +01:00
Isaac Freund 6c3f851464 Keyboard: eliminate "self" naming convention 2024-03-14 12:35:21 +01:00
Isaac Freund f02d26c533 InputManager: eliminate "self" naming convention 2024-03-14 12:34:28 +01:00
Isaac Freund 693a2b0dda XwaylandOverrideRedirect: eliminate "self" naming convention 2024-03-14 12:29:49 +01:00
Isaac Freund 28f30b2571 Mapping: eliminate "self" naming convention 2024-03-14 12:22:15 +01:00
Isaac Freund 904b623b84 XwaylandView: eliminate "self" naming convention 2024-03-14 12:21:21 +01:00
Isaac Freund 0e2cac08df XdgToplevel: eliminate "self" naming convention 2024-03-14 12:19:36 +01:00
Isaac Freund 2eb2a13284 Cursor: eliminate "self" naming convention 2024-03-14 12:08:24 +01:00
Isaac Freund 99a99b72e7 View: eliminate "self" naming convention 2024-03-14 12:07:27 +01:00
Isaac Freund d8f041c96f Output: eliminate "self" naming convention 2024-03-14 12:06:33 +01:00
Isaac Freund 267aa9a9b5 Seat: eliminate "self" naming convention 2024-03-14 12:05:36 +01:00
Isaac Freund 8a9b07ae4b Root: eliminate "self" naming convention 2024-03-14 12:04:15 +01:00
Isaac Freund aadb92dc0b Layout: eliminate "self" naming convention 2024-03-14 12:02:32 +01:00
Isaac Freund dabf7e9e97 Server: clean up initialization
This ended up uncovering a latent bug in the IdleInhibitorManager
initialization code, not sure how that ever worked.
2024-03-14 11:55:23 +01:00
Isaac Freund fecfa89a9a View: fix SSD desync on consecutive timeouts
If multiple consecutive transaction timeouts occur it is possible for
the SSD borders to become temporarily desynchronized with the size of
the rendered surface.

This is especially noticeable during interactive resize of mpv.

For details on cause/fix, see the new comment in the code.
2024-03-13 15:57:01 +01:00
Isaac Freund b0dc5f7294 View: improve transaction timeout handling
This fixes a possible assertion failure in Cursor.updateState() when
trying to start move/resize of a xdg toplevel with the timed_out or
timed_out_acked configure_state.

This also generally improves the UX of transaction timeouts as all
state except for the size change is now applied immediately.
2024-03-13 12:28:08 +01:00
Isaac Freund 46dbbe9799 deps: switch to codeberg upstreams, update 2024-03-12 14:12:54 +01:00
Isaac Freund 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
Isaac Freund 49a779b24d tablet-v2: implement tablet tool support
There is not any pointer emulation for tablet tool input. This means
that only clients implementing the tablet-v2 protocol will be able to
process tablet tool input.

Tablet pad support is TODO
2024-03-11 15:05:42 +01:00
Isaac Freund ac655593f3 View: remove faulty assertion
This assertion does not consider that a view may be visible on an output
despite no view on that output having focus due to a differnt output
currently having focus.

I don't see any clean way to fix the assert, so just remove it.
2024-03-09 13:47:36 +01:00
Isaac Freund 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
Isaac Freund f803ca6274 View: clean up attach-mode code, add assert 2024-03-08 11:56:34 +01:00
Isaac Freund 50d4f25eee build: enable frame pointers in release safe
These are by default only enabled for debug builds but give a higher
chance of getting a usable stack trace out of bug reports as Zig's
builtin stack trace dumping code doesn't handle their absence well in
all cases yet. The cost should be negligible as river is not CPU-bound.
2024-03-07 16:46:42 +01:00
Isaac Freund c4d6fab902 mailmap: map Isaac's old email to the new one
I assume that I'm not the only one who has changed/will change their
email over the years of river development, so this seems like a
reasonable thing to have.
2024-03-04 14:06:53 +01:00
Isaac Freund 60f4cafad0 river: only expose xwayland_shell_v1 to Xwayland
This is a private protocol only intended for the Xwayland client.
2024-03-02 17:37:04 +01:00
Isaac Freund 0eacde7d01 deps: update to latest zig-wayland and zig-wlroots 2024-03-02 17:36:47 +01:00
Isaac Freund 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
Isaac Freund 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
Isaac Freund 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