River seat status events are not fired if the river interface is bound
before the output globals are (despite
zriver_status_manager_v1_get_river_seat_status() not taking an output
as argument). See https://github.com/riverwm/river/issues/69 for
details.
Up until now, we had a workaround for this, where we deferred binding
the seat status interface until after all globals have been processed.
This did not help with runtime changes. For example, if a monitor is
turned off/on (with e.g. wlr-randr), all future river seat status
output events were lost, since the new output global was being
bound *after* the river seat status object.
This patch implements a new workaround, where we re-bind the river
seat status interface every time an output global is added.
Seat status v3 adds a new ‘mode’ event, that informs us of the current
mode (as set by e.g. ‘riverctl enter-mode passthrough’)
The mode is exposed as a tag (named “mode”) on river’s “title”
particle:
- river:
title:
map:
default: {empty: {}}
conditions:
mode == passthrough:
string: {text: " {mode} ", deco: {background: {color: ff0000ff}}}
When set, river tags and seats’ view titles apply to the output yambar
is on, only.
The default is disabled, which implements the old behavior, where
river tags and seats’ view titles represent the union of all
outputs.
This is mainly to fix a race when river is *not* running; sometimes we
ended up allocating particles for N seats in content(), but then when
iterating the seats, run() had destroyed all, or some of the seats,
causing us to feed NULL pointers to dynlist, which crashed.