Commit Graph

1110 Commits

Author SHA1 Message Date
novakane
f56c892958 build: Use pkg-config to handle river protocols 2021-07-28 19:30:50 +00: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
Rafael Escobar
90008cfa53
docs: fix typo in rivertile man page 2021-07-27 01:31:34 +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
Isaac Freund
b49ea34f15
build: remove example river-status client
This is out of date and currently doesn't compile. It also doesn't
really belong in the repository IMO, except maybe in the contrib
folder.
2021-07-25 19:15:33 +02:00
Isaac Freund
4cc1167863
river: improve new layer surface log formatting 2021-07-25 17:17:45 +02:00
Isaac Freund
734521560b
river: add custom wlroots log handler
This makes river's log output more consistent and will allow
filtering by the wlroots scope in the future.
2021-07-25 01:22:36 +02:00
Isaac Freund
c26d18647b
river: simplify log levels exposed to the user 2021-07-24 20:45:58 +02:00
Isaac Freund
8eaf7eb9cd
docs: fix inconsistent capitalization 2021-07-24 19:45:25 +02:00
Isaac Freund
aa19a1a964
docs: add -help and -version options to man pages 2021-07-24 19:42:34 +02:00
Isaac Freund
23088b800c
common: standardize on -help option
Also:

- Check for -help option *before* unknown options
- Use common flags parsing code for riverctl
- Add usage text to riverctl
2021-07-24 19:31:04 +02:00
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