Commit Graph

743 Commits

Author SHA1 Message Date
Isaac Freund
a5a505ecba
common: remove support for positional arguments
This is currently unused and I don't like the approach anymore
regardless. If/when we need positional arguments (probably when
implementing the upcoming river-control protocol in rivertile)
they should be handled separately from flags.

This commit also improves the CLI error reporting to always print the
usage string if invalid arguments were passed.
2021-07-24 18:29:48 +02:00
Isaac Freund
f6fa3425de
river: use common CLI arg parsing code
This makes river's main() function quite a bit cleaner.
2021-07-24 16:44:11 +02:00
novakane
32d35cdf91 Add -version flag to river, riverctl and rivertile 2021-07-24 14:14:53 +00:00
Isaac Freund
9c633a7888
layout: cleanup in progress layout demand on destroy
This fixes an issue where a layout client that crashed during a layout
demand caused river to enter invalid state and potentially soft-lock.
2021-07-24 14:14:36 +02:00
Isaac Freund
6f91011895
river: fix crash on parsing empty string as color 2021-07-24 10:39:38 +02:00
Isaac Freund
f371e00716
cursor: fix logic in Cursor.updateState()
The previous commit re-introduced a bug fixed by a3c65713 which caused
the pointer enter event not to be sent until moving the pointer when
switching tag focus or otherwise manipulating the window manager caused
the cursor to end up over a new surface.
2021-07-24 02:30:15 +02:00
Isaac Freund
53dd3875b3
cursor: avoid sending unnecessary pointer motion events
If the current Cursor.maybeResetState() function is called while in
passthrough mode, it will send a pointer motion event. This is
unnecessary as we have already sent the same pointer motion event at
least once.

Also refactor the code slightly and improve naming.
2021-07-23 19:18:49 +02:00
Isaac Freund
b243cd7fc3
river: destroy backend before Root.deinit()
Handling output destroy now requires the wlr_output_layout to still be
around, as we need it to properly handle cursor state. In order to make
sure that all outputs are destroyed before the wlr_output_layout is,
simply destroy the backend before calling Root.deinit().
2021-07-23 19:03:08 +02:00
Isaac Freund
36ce81bb67
cursor: add missing maybeResetState() callsite
This function needs to be called whenever pending state is made current,
which includes when views not tracked by the transaction system commit.
2021-07-23 18:37:24 +02:00
Isaac Freund
f86291169e
cursor: allow commands to override cursor operations
Now that we properly handle state changes during cursor operations,
blocking these commands if the target view is the target of a cursor
operation is unnecessary complexity. It is also inconsistent as we
don't block changing the tags of the view.
2021-07-23 17:11:43 +02:00
Isaac Freund
969d7b0344
cursor: remove surfaceAt() parameters
We always pass the current cursor position, so this is a nice
simplification.
2021-07-23 16:52:48 +02:00
Isaac Freund
7428519a93
cursor: refactor surfaceAt() to return parent
This allows us to properly handle e.g. clicking on a xdg popup of a view
that is not currently focused by focusing that xdg popup's parent view.
2021-07-23 16:33:25 +02:00
Isaac Freund
f62eedb048
render: sync with Cursor.surfaceAt(), draw all view popups
This was slightly out of sync with Cursor.surfaceAt() which did not
fullscreen or xwayland unmanaged views properly. Also simplify things
and improve correctness by always rendering all xdg popups. A view
losing focus does not always mean that all popups will be destroyed.
2021-07-23 15:42:47 +02:00
Leon Henrik Plickat
a3c6571326 cursor: reset state if needed on transaction commit
A transaction may move the current target of a cursor action to a
non-visible tag, make it fullscreen, or otherwise change things such
that the current cursor state no longer makes sense.

To handle this, check if we should reset cursor state every time a
transaction is committed.
2021-07-23 11:48:01 +00:00
Isaac Freund
b7d330c0da
river-layout: make minor copyediting fixes 2021-07-22 11:45:46 +02:00
Isaac Freund
b7e15a8ef6
river: make spawn command take only one argument
Currently the spawn command takes any number of arguments and naively
joins them together with spaces before passing them as the single
argument of `/bin/sh -c`. This however produces unexpected results as
soon as shell quoting gets involved in the arguments passed to spawn.
For example, running

riverctl spawn foo "bar baz"

will execute `/bin/sh -c "foo bar baz"`, unexpectedly splitting bar and
baz into separate arguments. To avoid this confusion, make the spawn
command take only a single argument, forcing the user to quote properly
to spawn multi-argument commands.
2021-07-21 14:07:49 +02:00
Leon Henrik Plickat
dfa2471141
contrib: update layout.c for river-layout-v3 2021-07-21 14:01:51 +02:00
Isaac Freund
1d000e5666
rivertile: simplify commands
Instead of having separate commands for modifying/setting a value, use
the presence of a +/- sign to indicate modification.
2021-07-21 14:01:51 +02:00
novakane
22251fa7ed
completions: Update for river-layout-v3 2021-07-20 10:48:48 +02:00
Isaac Freund
2635f3299a
river-layout: update to v3
- Remove advertise_view and advertise_done events. Using the information
provided by these for any purpose would make the layout far less
predictable. Futhermore, in the months this has been available for use,
to my knowledge nobody has actually used it for anything useful.

- Replace the set/mod layout value events with a single user_command
event. This simplifies the protocol and is more flexible for clients.

- Add a layout_name argument to the commit request. This name is an
arbitrary, user-facing string that might, for example, be displayed by a
status bar. This was present in early drafts of the protocol, but was
removed in favor of river-options. Since river-options itself has since
been removed and this feature is nice to have, re-add it.

- Rename main factor to main ratio in rivertile. The "factor" name was
just legacy from dwm, "ratio" is much more accurate.
2021-07-20 10:48:11 +02:00
Isaac Freund
96e1082156 river: remove opacity command
This code is complex and increases maintenance burden but doesn't
add any functionality, only eye-candy.

Futhermore, neither I nor any of the core contributors use it.

There may be a place in river for such eye-candy down the line, in which
case this code could be revived. Currently river is early enough in its
development that our focus should be on core functionality instead.
2021-07-20 08:47:02 +00:00
Isaac Freund
b6212ba972
docs: improve formatting consistency 2021-07-20 02:31:24 +02:00
Alexander Taylor
1fec079266 Fix typo s/ouput/output/ in function name 2021-07-19 12:01:10 +00:00
Isaac Freund
f30610d64c
docs: mention man pages before wiki
Don't want people getting the idea that the wiki is more important. The
man pages are the only official documentation.
2021-07-17 16:13:10 +02:00
Isaac Freund
d6ad06ae87
docs: simplify README 2021-07-17 16:10:07 +02:00
Isaac Freund
0063c722e5
river: remove system /etc dir from init search paths
A true "default" config doesn't make sense for river. Everyone who uses
river seriously will customize their init script. Futhermore, the
current behavior of embedding the install path of the default system
config in the river binary is complex and prone to breaking.
2021-07-17 16:04:51 +02:00
Viktor Nagy
28fc8792d7 river: add focus-previous-tags command 2021-07-15 12:00:22 +00:00
Isaac Freund
604cf98047
command: make args type 0-terminated
Since we often need to pass these args back C code, keeping the 0 byte
around saves some allocations.
2021-07-15 13:32:33 +02:00
Isaac Freund
3c951fed74
view: fix typo causing UB on resizing xwayland views 2021-07-14 23:51:49 +02:00
Isaac Freund
d413db9227
xdg-shell: set resizing state during interactive resize 2021-07-14 15:32:24 +02:00
Isaac Freund
7b18b4944e config: use hash sets for filters, clean up code 2021-07-12 17:57:01 +00:00
Leon Henrik Plickat
968aef3459 river: make CSD-filters apply to existing views 2021-07-12 17:57:01 +00:00
Leon Henrik Plickat
9ec04c764e river: add commands to remove filter entries 2021-07-12 17:57:01 +00:00
novakane
177b99c6e2 README: add a link to the wiki 2021-07-07 13:20:51 +00:00
Steef Hegeman
ba6a38f491 completions: typo
focus-follows-cursor instead of focus-follow-cursor
2021-07-02 19:11:36 +02:00
Isaac Freund
e2e4cd2953
doc: remove dead wiki link from readme
river is now in nixpkgs so this page and the link are undeeded.
2021-06-30 11:04:33 +02:00
Isaac Freund
39578db134
render: @panic() if CLOCK_MONOTONIC is not supported
Making this unreachable and invoking illegal behavior is incorrect.
2021-06-27 13:20:36 +02:00
Isaac Freund
df492f83e6 completions: add set-cursor-warp for zsh/fish 2021-06-26 19:03:49 +02:00
Leon Henrik Plickat
61829d82fe completions: Add bash completion for set-cursor-warp commands 2021-06-26 19:03:49 +02:00
Leon Henrik Plickat
085cca0d5e cursor: add option to warp on output change
On output change, if the cursor is not already on the newly focused
output, it will now be warped to its center. The check is necessary,
since focusing outputs with the pointer will be implemented in
the future.
2021-06-26 19:03:49 +02:00
Isaac Freund
505639432e
Revert "build: assert wlroots version at comptime"
zig-wlroots now has this assert built in

This reverts commit 3392b21aa8.
2021-06-24 20:21:07 +02:00
Isaac Freund
3392b21aa8
build: assert wlroots version at comptime
This will prevent people compiling river against the wrong wlroots
version and wondering why it crashes.
2021-06-24 19:34:15 +02:00
Isaac Freund
951c11f642 ci: build wlroots from source 2021-06-23 15:35:10 +02:00
Isaac Freund
41874b47ae code: update to wlroots 0.14.0 2021-06-23 15:35:10 +02:00
Leon Henrik Plickat
d3a9e96f7d Add spacial output operations
List based output operations are tedious for complex output layouts.
2021-06-23 12:47:20 +02:00
Isaac Freund
3efcfedcf4
layer-shell: handle commits before map
A client is free to change its mind and request a different
size/anchor/etc after recieving the initial configure but before
attaching and committing the first buffer. This means that we should
respond to such a situation with a new configure.

mako has been observed doing this in the wild for example.
2021-06-22 14:07:14 +02:00
Isaac Freund
a2c81adba0
xdg-toplevel: remove listeners before view destroy
Currently in handleUnmap() we call View.unmap() before removing
listeners. However View.unmap() may destroy the view before returning
if the transaction started doesn't have to wait on any configures.

To ensure that we don't try to remove listeners which have already been
free'd, do this before calling View.unmap().
2021-06-17 20:57:14 +00:00
Isaac Freund
5daec347c0
render: damage on background/border color change 2021-06-16 17:42:09 +00:00
Leon Henrik Plickat
3405e2a87c Ignore move and resize requests from fullscreened XDG toplevels 2021-06-16 10:03:30 -07:00
FollieHiyuki
12c12c4b6c completions: add fish completion for input command 2021-06-16 09:59:37 -07:00