river-options: remove protocol

This protocol involves far too much accidental complexity. The original
motivating use-case was to provide a convenient way to send arbitrary
data to layout clients at runtime in order to avoid layout clients
needing to implement their own IPC and do this over a side-channel.
Instead of implementing a quite complex but still rigid options protocol
and storing this state in the compositor, instead we will simply add
events to the layout protocol to support this use case.

Consider the status quo event sequence:

1. send get_option_handle request (riverctl)
2. roundtrip waiting for first event (riverctl)
3. send set_foo_value request (riverctl)
4. receive set_foo_value request (river)
5. send foo_value event to all current handles (river)
6. receive foo_value event (rivertile)
7. send parameters_changed request (rivertile)
8. receive parameters_changed request (river)
9. send layout_demand (river)

And compare with the event sequence after the proposed change:

1. send set_foo_value request (riverctl)
2. receive set_foo_value request (river)
3. send set_foo_value event (river)
4. send layout_demand (river)

This requires *much* less back and forth between the server and clients
and is clearly much simpler.
This commit is contained in:
Isaac Freund
2021-04-26 21:03:04 +02:00
parent a6f908d7eb
commit 871fc7c8de
17 changed files with 65 additions and 1449 deletions

View File

@ -42,13 +42,13 @@ riverctl map normal $mod Return zoom
# Mod+H and Mod+L to decrease/increase the main_factor option by 0.05
# rivertile(1) uses this option to determine the width of the main stack.
riverctl map normal $mod H spawn riverctl mod-option -focused-output main_factor -0.05
riverctl map normal $mod L spawn riverctl mod-option -focused-output main_factor +0.05
#riverctl map normal $mod H spawn riverctl mod-option -focused-output main_factor -0.05
#riverctl map normal $mod L spawn riverctl mod-option -focused-output main_factor +0.05
# Mod+Shift+H and Mod+Shift+L to increment/decrement the main_count option.
# rivertile(1) uses this option to determine the number of "main" views in the layout.
riverctl map normal $mod+Shift H spawn riverctl mod-option -focused-output main_count +1
riverctl map normal $mod+Shift L spawn riverctl mod-option -focused-output main_count -1
#riverctl map normal $mod+Shift H spawn riverctl mod-option -focused-output main_count +1
#riverctl map normal $mod+Shift L spawn riverctl mod-option -focused-output main_count -1
# Mod+Alt+{H,J,K,L} to move views
riverctl map normal $mod+Mod1 H move left 100
@ -104,10 +104,10 @@ riverctl map normal $mod Space toggle-float
riverctl map normal $mod F toggle-fullscreen
# Mod+{Up,Right,Down,Left} to change layout orientation
riverctl map normal $mod Up spawn riverctl set-option -focused-output main_location top
riverctl map normal $mod Right spawn riverctl set-option -focused-output main_location right
riverctl map normal $mod Down spawn riverctl set-option -focused-output main_location bottom
riverctl map normal $mod Left spawn riverctl set-option -focused-output main_location left
#riverctl map normal $mod Up spawn riverctl set-option -focused-output main_location top
#riverctl map normal $mod Right spawn riverctl set-option -focused-output main_location right
#riverctl map normal $mod Down spawn riverctl set-option -focused-output main_location bottom
#riverctl map normal $mod Left spawn riverctl set-option -focused-output main_location left
# Declare a passthrough mode. This mode has only a single mapping to return to
# normal mode. This makes it useful for testing a nested wayland compositor
@ -155,7 +155,7 @@ riverctl csd-filter-add "gedit"
# Set opacity and fade effect
# riverctl opacity 1.0 0.75 0.0 0.1 20
# Exec into the default layout generator, rivertile.
# Set and exec into the default layout generator, rivertile.
# River will send the process group of the init executable SIGTERM on exit.
riverctl set-option layout rivertile
riverctl default-layout rivertile
exec rivertile