Commit Graph
100 Commits
Author SHA1 Message Date
Isaac Freund 50c9e3d81b Cursor: revive 'always' focus-follows-cursor mode
This was removed a while back because it was buggy and I didn't know
of anyone using it. Since refactoring it is now trivial to implement
and I know of at least one person using it, so I don't mind reviving it.
2022-06-03 12:03:08 +02:00
Isaac Freund 2df2151afa river-status: only send mode event if client bound version 3 2022-06-02 12:21:57 +02:00
Isaac Freund d657dc791b river-status: add mode event to seat status
This allows clients such as a status bar to display the currently active
mode.
2022-06-01 00:15:09 +02:00
Isaac Freund 03e8da669c Xwayland: Rename XwaylandUnmanaged to XwaylandOverrideRedirect 2022-05-30 01:08:09 +02:00
Isaac Freund 706dca9b1a ci: fix xbps invocation 2022-05-29 20:17:39 +02:00
Isaac Freund 960afa89ec View: refactor initialization
This anytype parameter is a wart that's been around for far too long.
2022-05-29 16:28:12 +02:00
Isaac Freund 6ef97eea24 Xwayland: handle override redirect state changes 2022-05-29 16:28:07 +02:00
Isaac Freund d1997139cc docs: add note on example init file to PACKAGING.md 2022-05-22 19:17:14 +02:00
Isaac Freund 71ba891850 docs: expand on -Dcpu in PACKAGING.md 2022-05-22 16:17:55 +02:00
Isaac Freund d0625d668a docs: create PACKAGING.md 2022-05-22 15:35:42 +02:00
Isaac Freund 3cb6428da6 build: add -Dstrip and -Dpie build options 2022-05-22 15:25:38 +02:00
Isaac Freund ded490d3dd Output: remove overzealous assert
If running river with WLR_BACKENDS=headless, every output is headless
not just the noop output.
2022-05-20 15:13:28 +02:00
Isaac Freund 7c440b834e build: follow semantic versioning for -dev versions
The new version format is 0.2.0-dev.76+d1cf95b which is compliant to the
semantic versioning 2.0.0 spec and sorts better than the old format.
2022-05-16 22:34:43 +02:00
Isaac Freund 7122df7ec4 layer-shell: fix overflow if desired size exceeds output bounds 2022-05-16 19:03:23 +02:00
Isaac Freund d47be3b592 deps: update to latest zig-wayland 2022-05-11 18:02:32 +02:00
Isaac Freund 90b37645cf ci: make wget output non verbose
This still prints errors, but doesn't print progress bars or other
superfluous information.
2022-05-01 19:03:32 +02:00
Isaac Freund e0246c0410 Cursor: Don't passthrough() on update if hidden
Currently when the surface under the hidden cursor changes, we
passthrough() which results in the cursor being made visible and giving
pointer focus to the surface under the cursor if any. Obviously this is
not desirable as the cursor is supposed to remain hidden until moved.
This added check prevents this.
2022-04-19 11:10:53 +02:00
Isaac Freund ae349b0ce4 layer-shell: fix overflow with large bottom margin 2022-03-28 12:11:28 +02:00
Isaac Freund adf6e1f19d layer-shell: allow surfaces larger than the output
The motivation for this change is to simplify the implementation
and remove a massive footgun that is currently present and causing
UB/crashes. If a layer surface is destroyed in arrangeLayers() then
the code in LayerSurface.handleCommit() after the arrangeLayers()
call accesses free'd memory. This is of course possible to fix,
but it's far simpler to loosen up the protocol implementation a bit.

The new implementation is also in line with what sway and the new
wlroots layer shell helper do and is perfectly valid according to
the protocol.
2022-03-05 14:25:20 +01:00
Isaac Freund 238c39379d doc: Add additional style rule to CONTRIBUTING.md 2022-03-02 15:34:51 +01:00
Isaac Freund 7b4c9c39ee DragIcon: Properly initialize if already mapped 2022-02-26 16:54:48 +01:00
Isaac Freund 1c1be3e0bb rivertile: use u31s to remove most @intCast()s 2022-02-26 16:19:15 +01:00
Isaac Freund e67a9423a8 rivertile: properly validate -main-ratio flag 2022-02-21 10:26:10 +01:00
Isaac Freund 147d9c2f90 View: use last set fullscreen state in applyPending()
This avoids a race where the fullscreen set is e.g. set then unset
before the transaction has been completed and the current state has
been updated.
2022-02-05 00:08:21 +01:00
Isaac Freund be870e058d View: fix/simplify logic in applyPending()
In particular, this fixes a crash that can happen if a client is made
non-fullscreen and then, while that transaction is ongoing, made
fullscreen again.
2022-02-03 21:23:02 +01:00
Isaac Freund 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
Isaac Freund 363efd3e79 ci: run on 0.1.x branch 2022-01-29 13:48:50 +01:00
Isaac Freund 1e3ea826c0 wlr-output-management: simplify implementation
Notably, we no longer call both wlr_output_test and wlr_output_commit
when applying an output config, which seems to fix or workaround an
occasional crash since updating to wlroots 0.15.0.
2022-01-28 23:28:00 +01:00
Isaac Freund 745fe82947 layer-shell: center when opposing anchors are set
Currently river will place the surface at the top or left edge if
opposing anchors are set without a 0 width/height. Instead, center
the surface between the anchors.
2022-01-25 00:11:20 +01:00
Isaac Freund b716e262cd XdgPopup: remove commit listener on destroy if mapped
Since the destroy() function may be called by river while the popup is
mapped, we must handle this case.
2022-01-23 20:37:37 +01:00
Isaac Freund 20ca8a2051 docs: fix typo in river(1) man page 2022-01-23 12:09:27 +01:00
Isaac Freund f6b1632af2 example/init: Use Alt/Super aliases 2022-01-17 13:15:15 +01:00
Isaac Freund f79c784e84 command/map: add Alt/Super as aliases for Mod1/Mod4
I personally made the mistake of using Alt instead of Mod1 when messing
with my config. This change makes things a bit more user
friendly/intuitive.
2022-01-17 12:38:41 +01:00
Isaac Freund c9fd8b3f37 XdgPopup: fix unconstrain from box coords
We currently don't properly handle xdg surface geometry of the parent,
which causes popups to render partially off-screen in some cases.

GTK4 clients such as easyeffects seem to trigger this issue reliably.
2022-01-12 14:50:55 +01:00
Isaac Freund a340a605a4 Cursor: remove minor outdated workaround
Since Zig 0.9 @tagName() and other similar builtins return 0 terminated
data.
2022-01-05 18:13:08 +01:00
Isaac Freund 1c515759b4 Seat: do a better job of cleaning up listeners
I thought this should be fine as river won't yield to the event loop
when Seat.deinit() is called before the wlroots seat is destroyed, but
a segfault on exit has been reported with a stack trace mentioning
wlr_seat_destroy(). Let's hope this clears that up.
2022-01-02 19:46:18 +00:00
Isaac Freund e16eabd928 Xwayland: move window to top of X11 stack on focus
This is required for X11 input handling to work properly with
overlapping windows.
2022-01-02 04:32:28 +00:00
Isaac Freund ea4bd5e54b Cursor: fix down mode motion events for subsurfaces
There are a couple of TODOs here that are not worth resolving until
after moving to the scene graph api.
2021-12-29 06:19:37 +00:00
Isaac Freund c1d985ac29 build: update to zig version 0.9.0 2021-12-24 05:28:14 +00:00
Isaac Freund 1edaa5ad21 docs: soften the README disclaimer a bit 2021-12-22 22:09:45 +00:00
Isaac Freund 6a093fecee river: remove wlroots 0.14 workarounds
Since updating to wlroots 0.15 we can remove several workarounds we had
in place due to wlroots improvements.
2021-12-22 20:15:57 +00:00
Isaac Freund 90aee02b70 Subsurface: add commit listener on create if mapped
Subsurfaces may already be mapped when create is called, in which case
we must add the commit listener.
2021-12-22 05:30:20 +00:00
Isaac Freund 334ede00e1 Cursor: properly handle clients setting the cursor image
The new code to dedup XcursorManager.setCursorImage() calls for
efficiency currently doesn't handle clients setting the cursor properly.
This commit corrects this oversight.
2021-12-22 04:32:23 +00:00
Isaac Freund 2288778dd7 ci: update for wlroots 0.15.0 2021-12-22 03:56:47 +00:00
Isaac Freund 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
Isaac Freund f2fc9aca18 Cursor: dedup XcursorManager.setCursorImage() calls
wlroots doesn't avoid re-setting the same cursor image so this is
relatively expensive to call repeatedly if nothing has changed.
2021-12-21 03:50:12 +00:00
Isaac Freund 4d19621f1e river: update to wlroots 0.15.0 2021-12-21 03:18:30 +00:00
Isaac Freund c3370afa3d common/flags: make argFlag() return a slice
We always pass the result of this to mem.span() currently, no need for
the code duplication.
2021-12-15 17:09:45 +01:00
Isaac Freund 93afdb32bf layer-shell: tighten up handling of large margins 2021-11-29 23:56:26 +01:00
Isaac Freund bd70c010e9 Cursor: add workaround in pointer drag termination
Currently wlroots sends use the drag destroy event before sending the
wl_data_device.leave event to the client, which makes things a bit
awkward. My patch fixing this has been merged to wlroots master so we
can remove this when upgrading to wlroots 0.15, but until then this
workaround will fix the issue.
2021-11-23 22:54:19 +01:00
Isaac Freund 9212ac89fa Cursor: fix pointer drags with focus-follows-cursor 2021-11-19 11:33:27 +01:00
Isaac Freund 0cbe2b9fc3 docs: remove reference to /etc/river/init
We used to look in /etc/river/init if no init at ~/.config/river/init
or $XDG_CONFIG_HOME/river/init was found but this feature was
removed. It seems that we forgot to remove this mention of the old
behavior however.
2021-11-11 16:07:19 +01:00
Isaac Freund f3475c5932 docs: clarify description of dependencies 2021-11-03 13:40:46 +01:00
Isaac Freund 18072e00bf build: bump version to 0.2.0-dev 2021-11-03 00:31:55 +01:00
Isaac Freund 40e6a83ba8 build: bump version to 0.1.0 2021-11-03 00:01:31 +01:00
Isaac Freund 69d1453741 build: fix trailing newline in version string 2021-11-02 23:54:44 +01:00
Isaac Freund d4aa64034c docs: remove AUTHORS file
We haven't managed to keep this at all up to date, which defeats the
purpose. Please refer to the git history for a complete list of
contributors.
2021-11-02 23:29:23 +01:00
Isaac Freund c9de08fa10 docs: update URLs for migration to riverwm github org 2021-11-01 11:28:43 +01:00
Isaac Freund f2cf4b9455 common: use -h instead of -help
This doesn't really matter that much as unrecognized options will still
trigger a help message to be printed, but -h is much more standard so
lets make the predictable choice here while sticking to only single '-'
flags.
2021-11-01 00:34:15 +01:00
Isaac Freund 4cee1fb881 docs: assorted fixes/cleanups 2021-11-01 00:29:06 +01:00
Isaac Freund 8757644b2a docs: standardize on "layout generator"
This is likely more clear than "layout client" to most users.
2021-10-31 22:32:59 +01:00
Isaac Freund 8134b81283 Cursor: fix move/resize with high poll rate/low dpi mice 2021-10-30 20:40:35 +02:00
Isaac Freund 4b0c5acc46 View: fix checks to respect client side move/resize 2021-10-30 12:54:23 +02:00
Isaac Freund b986196118 view: respect client size resize of floating views
mpv for example has key bindings to set the window size to a multiple of
the video resolution. This is a valid use case for client-size resizing
of the view and river should respect this if the view is floating.
2021-10-30 12:22:49 +02:00
Isaac Freund e447e1b41f Xwayland: always send configure if requested
This seems to fix an issue with mouse input for steam if steam is not
started on an output at 0,0. X11 is pretty spooky.
2021-10-20 15:40:50 +02:00
Isaac Freund c84fd1a936 View: send enter/leave events to full surface tree 2021-10-20 14:11:19 +02:00
Isaac Freund 5bf7d22972 Cursor: only trigger focus-follow-cursor on motion
This greatly improves the UX of this feature, as views moving under a
stationary cursor (as happens during the zoom command for example) will
no longer trigger focus change.
2021-10-20 13:22:24 +02:00
Isaac Freund 4b94b9c083 Xwayland: honor fullscreen requests 2021-10-12 18:47:08 +02:00
Isaac Freund 50814e0ffe pointer-constraints: fix coordinates
Currently the implementation treats the x/y coordinates of
View.State.box as layout coordinates instead of output-relative. This
causes issues when using an output not at 0,0.
2021-10-11 15:01:57 +02:00
Isaac Freund 3b24e7fcd5 contrib: recommend using a venv for layout.py
This avoids needing to run pwayland's scanner with root privileges and
install the river-layout bindings to system directories.
2021-10-06 12:16:36 +02:00
Isaac Freund 5b8eab569c Server: fix use after free in deinit()
The input manager and seats must be destroyed before the display is
destroyed as they need to destroy their timer event sources used for key
repeat.
2021-10-02 14:48:23 +02:00
Isaac Freund 9270a2df08 View: fix unmap/destroy control flow
Currently the view destruction sequence is started as soon as a view
is unmapped. However, this is incorrect as a client may map the view
again instead of destroying it.

Instead, only start the view destruction sequence when the underlying
xdg toplevel or xwayland surface is destroyed.
2021-10-02 14:48:22 +02:00
Isaac Freund e0784247b6 doc: update my (Isaac's) email address 2021-10-02 13:01:58 +02:00
Isaac Freund fd70a93c67 View: add fullscreen check missing in previous commit 2021-10-02 12:05:24 +02:00
Isaac Freund e6bb373240 View: resize if moved between outputs while fullscreen 2021-09-30 17:17:46 +02:00
Isaac Freund 8ec0e30fd7 Subsurface: remove commit listener in destroy()
Currently if destroy() is called while a subsurface is mapped a dangling
commit listener is left behind. This is obivously a problem, so check if
the subsurface is mapped in destroy() and remove the listener if needed.
2021-09-30 16:45:14 +02:00
Isaac Freund 6616d32353 ci: fix xbps invocation
This avoids errors like:

util-linux-common-2.37.2_1 in transaction breaks installed pkg `libfdisk-2.37.1_1'
util-linux-common-2.37.2_1 in transaction breaks installed pkg `libsmartcols-2.37.1_1'
libuuid-2.37.2_1 in transaction breaks installed pkg `libfdisk-2.37.1_1'
libuuid-2.37.2_1 in transaction breaks installed pkg `util-linux-2.37.1_1'
libblkid-2.37.2_1 in transaction breaks installed pkg `libfdisk-2.37.1_1'
libblkid-2.37.2_1 in transaction breaks installed pkg `util-linux-2.37.1_1'
libmount-2.37.2_1 in transaction breaks installed pkg `util-linux-2.37.1_1'
Transaction aborted due to unresolved dependencies.
2021-09-27 19:10:46 +02:00
Isaac Freund a3fdb294b3 Cursor: implement surfaceAt() for XwaylandUnmanaged 2021-09-27 18:34:59 +02:00
Isaac Freund b8ebbc29cf xdg-toplevel: fix configure serial checking
Currently if another configure is in flight after the one we are
tracking the serial of and the client acks the second configure as well
(or only the second configure) before committing, we will never realize
the configure we are tracking has been acked.

Instead, listen for the ack_configure signal and set a bool that we can
check on surface commit.

This probably isn't an issue that would actually be hit by well behaved
clients as river doesn't send redundant configure events. However,
having correct code is always better even if it's slightly more complex.
2021-09-18 18:45:30 +02:00
Isaac Freund 98aed8d47e river: fix viewporter protocol implementation
It turns out that wlroots requires us to do a bit more than just create
the wlr_viewporter. Docs are being added to the wlroots header in
https://github.com/swaywm/wlroots/pull/3171
2021-09-06 19:03:17 +02:00
Isaac Freund 119d733bdf docs: update example init for float fitler changes 2021-09-06 14:46:34 +02:00
Isaac Freund 6e51a8fcdd river-status: fix output status destruction
There was a use-after-free if the Output was destroyed first, and the
memory of the output status was leaked.
2021-08-12 22:38:08 +02:00
Isaac Freund d4c249a5cb output: simplify layer shell handling on destroy
No need for noop output hacks here, wlr.LayerSurfaceV1.close()
synchronously emits the unmap signal if the layer surface is mapped.
2021-08-12 21:58:17 +02:00
Isaac Freund 1e18ac9d74 layer-shell: ignore commits on closed layer surface 2021-08-12 21:18:26 +02:00
Isaac Freund 1baf3bf462 seat: always add view to focus stack on map
Currently if a view is mapped while some other view is fullscreen, it
will not be added to the focus stack, which means that if the fullscreen
view is then closed the view which was not added to the focus stack will
not be focused.

To fix this, always add views to the focus stack on map.
2021-08-10 21:54:36 +02:00
Isaac Freund e752555969 config: fix leak of default layout namespace 2021-08-09 16:48:51 +02:00
Isaac Freund 7013bc3b69 Xwayland: fix possible use-after-free on unmap
The view.unmap() call may synchronously destroy the view, which makes
the the code removing listeners which is currently run after
view.unmap() access free'd memory.

To fix this, simply change the order of the calls to match that of
XdgToplevel.handleUnmap().
2021-08-09 16:40:45 +02:00
Isaac Freund 2fc0875a3e river: fix crash on disabling all outputs
If using the on-output-change cursor warp option river currently crashes
when the last real output is disabled as the noop output used as a
fallback is not present in the output layout.
2021-08-02 16:16:58 +02:00
Isaac Freund 295f965f91 river-layout: fix typo in protocol 2021-08-02 15:58:56 +02:00
Isaac Freund 2f3fe5019b util: remove unused function 2021-07-31 00:57:23 +02:00
Isaac Freund 00f51e00b4 cursor: remove strict focus-follows-cursor mode
This is pretty much unusable after recent improvements to the cursor
code, and was totally broken causing a stack overflow as soon as the
cursor was moved over any surface until the previous commit.

Furthermore, none of the core contributors or people active on IRC seem
to use it.
2021-07-29 14:05:17 +02:00
Isaac Freund bae826ef0e cursor: fix crash if focus-follows-cursor is set
Currently we hit a stack overflow as we do not check if the target view
already has keyboard focus before calling Seat.focus() in
Cursor.passthrough(). To fix this, simply add this check.
2021-07-29 13:42:36 +02:00
Isaac Freund 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
Isaac Freund 9e70fb25a5 output: fix debug log on tag change 2021-07-28 13:44:23 +02:00
Isaac Freund 8a1e96cddc config: change color format to 0xRRGGBBAA
The current format of #RRGGBBAA is problematic as # starts a comment
in POSIX compliant shells, requiring escaping/quoting and increasing
complexity.

This is a breaking change.
2021-07-26 20:36:46 +02:00
Isaac Freund ae871c2fee docs: Wayland should always be capitalized
This matches the style used on https://wayland.freedesktop.org/
2021-07-26 12:20:48 +02:00
Isaac Freund bbfd0c334c view: arrange when exiting fullscreen to layout
This arrange is actually required because the post_fullscreen box might
not hold the correct dimensions if the view was made fullscreen while
a transaction was already in progress.
2021-07-25 22:30:47 +02:00
Isaac Freund 988a4623ab view: ensure saved buffers are always dropped
Currently if a view is moved from layout to fullscreen while a
transaction involving that view is in progress the saved buffers are not
dropped, which causes stale state to be rendered.
2021-07-25 22:22:46 +02:00
Isaac Freund eab9c0901a layout: assert output state matches layout applied
This is guaranteed to already be set to the layout being committed. It
is set either when a client binds a new layout object or when the user
changes the layout namespace in use.
2021-07-25 22:17:40 +02:00
Isaac Freund a07e5de945 build: install river-layout-v3 to $PREFIX/share/river
This makes it easier for other projects (i.e. everyone's layout
generators) to depend on the protocol xml without needing to vendor it.

The river-layout-v3 protocol should remain stable for the
forseeable future, hopefully forever. On the other hand, the current
river-control-unstable-v1 and river-status-unstable-v1 protocols
will be replaced as soon as we have time to implement better
versions. Therefore, let's not encourage usage of the protocols we
intend to remove.
2021-07-25 19:31:38 +02:00