diff --git a/Cargo.lock b/Cargo.lock index 3358040..0e9783d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "autocfg" @@ -28,9 +28,9 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "cairo-rs" -version = "0.20.5" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fa699e1d7ae691001a811dda5ef0e3e42e1d4119b26426352989df9e94e3e6" +checksum = "ae50b5510d86cf96ac2370e66d8dc960882f3df179d6a5a1e52bd94a1416c0f7" dependencies = [ "bitflags", "cairo-sys-rs", @@ -40,9 +40,9 @@ dependencies = [ [[package]] name = "cairo-sys-rs" -version = "0.20.0" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428290f914b9b86089f60f5d8a9f6e440508e1bcff23b25afd51502b0a2da88f" +checksum = "f18b6bb8e43c7eb0f2aac7976afe0c61b6f5fc2ab7bc4c139537ea56c92290df" dependencies = [ "glib-sys", "libc", @@ -51,9 +51,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c360837f8f19e2e4468275138f1c0dec1647d1e17bb7c0215fe3cd7530e93c25" +checksum = "8d4ba6e40bd1184518716a6e1a781bf9160e286d219ccdb8ab2612e74cfe4789" dependencies = [ "smallvec", "target-lexicon", @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.21" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "9560b07a799281c7e0958b9296854d6fafd4c5f31444a7e5bb1ad6dde5ccf1bd" dependencies = [ "clap_builder", "clap_derive", @@ -71,9 +71,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "874e0dd3eb68bf99058751ac9712f622e61e6f393a94f7128fa26e3f02f5c7cd" dependencies = [ "anstyle", "clap_lex", @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "equivalent" @@ -168,9 +168,9 @@ dependencies = [ [[package]] name = "gio" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8826d2a9ad56ce3de1f04bea0bea0daff6f5f1c913cc834996cfea1f9401361c" +checksum = "a517657589a174be9f60c667f1fec8b7ac82ed5db4ebf56cf073a3b5955d8e2e" dependencies = [ "futures-channel", "futures-core", @@ -185,9 +185,9 @@ dependencies = [ [[package]] name = "gio-sys" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b965df6f3534c84816b5c1a7d9efcb5671ae790822de5abe8e299797039529bc" +checksum = "8446d9b475730ebef81802c1738d972db42fde1c5a36a627ebc4d665fc87db04" dependencies = [ "glib-sys", "gobject-sys", @@ -198,9 +198,9 @@ dependencies = [ [[package]] name = "glib" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bd3e4ee7998ab5a135d900db56930cc19ad16681adf245daff54f618b9d5e1" +checksum = "f969edf089188d821a30cde713b6f9eb08b20c63fc2e584aba2892a7984a8cc0" dependencies = [ "bitflags", "futures-channel", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "glib-macros" -version = "0.20.5" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d21ca27acfc3e91da70456edde144b4ac7c36f78ee77b10189b3eb4901c156" +checksum = "715601f8f02e71baef9c1f94a657a9a77c192aea6097cf9ae7e5e177cd8cde68" dependencies = [ "heck", "proc-macro-crate", @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "glib-sys" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0b1827e8621fc42c0dfb228e5d57ff6a71f9699e666ece8113f979ad87c2de" +checksum = "b360ff0f90d71de99095f79c526a5888c9c92fc9ee1b19da06c6f5e75f0c2a53" dependencies = [ "libc", "system-deps", @@ -242,9 +242,9 @@ dependencies = [ [[package]] name = "gobject-sys" -version = "0.20.4" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c674d2ff8478cf0ec29d2be730ed779fef54415a2fb4b565c52def62696462" +checksum = "67a56235e971a63bfd75abb13ef70064e1346388723422a68580d8a6fbac6423" dependencies = [ "glib-sys", "libc", @@ -283,9 +283,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -299,9 +299,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "libc" -version = "0.2.166" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "memchr" @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "pango" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e34e7ca2c52e3933d7e5251409a82b83725fa9d6d48fbdaacec056b3a0554a" +checksum = "9e89bd74250a03a05cec047b43465469102af803be2bf5e5a1088f8b8455e087" dependencies = [ "gio", "glib", @@ -332,9 +332,9 @@ dependencies = [ [[package]] name = "pango-sys" -version = "0.20.4" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84fd65917bf12f06544ae2bbc200abf9fc0a513a5a88a0fa81013893aef2b838" +checksum = "71787e0019b499a5eda889279e4adb455a4f3fdd6870cd5ab7f4a5aa25df6699" dependencies = [ "glib-sys", "gobject-sys", @@ -344,9 +344,9 @@ dependencies = [ [[package]] name = "pangocairo" -version = "0.20.4" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4291ca8cdd05e4330752bf8a450d3a4e701ca48fd9aad2b3566e92849ee4055e" +checksum = "4690509a2fea2a6552a0ef8aa3e5f790c1365365ee0712afa1aedb39af3997b6" dependencies = [ "cairo-rs", "glib", @@ -357,9 +357,9 @@ dependencies = [ [[package]] name = "pangocairo-sys" -version = "0.20.4" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ed959258ea648a49bde7dfdbaa98310717cb15159b421fa76510c45ec306e" +checksum = "5be6ac24147911a6a46783922fc288cf02f67570bc0d360e563b5b26aead6767" dependencies = [ "cairo-sys-rs", "glib-sys", @@ -370,9 +370,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -406,18 +406,18 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.37.1" +version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22f29bdff3987b4d8632ef95fd6424ec7e4e0a57e2f4fc63e489e75357f6a03" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" dependencies = [ "memchr", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -430,18 +430,18 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -450,9 +450,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -514,9 +514,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "syn" -version = "2.0.89" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -590,9 +590,9 @@ checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "wayrs-client" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "108e826de1c83006f6482b0025ce307a17e558e14d8b224edc92a6e39862f87c" +checksum = "3143d1c29da3e8b28d5e41dae7b62018633331b0a0fa38695f5b7b444df588e7" dependencies = [ "wayrs-core", "wayrs-scanner", @@ -609,27 +609,27 @@ dependencies = [ [[package]] name = "wayrs-proto-parser" -version = "2.0.4" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96cfdd04fbb1d8afe83c0c0e87138ef6643c4447ba65067242e99f6edd80ae2" +checksum = "2cf4577ebb06017a5dd3bb8f24e01c88f361f585c7fd43e8bc61a75f01651922" dependencies = [ "quick-xml", ] [[package]] name = "wayrs-protocols" -version = "0.14.3" +version = "0.14.5+1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28591a3ed941f8db9a747f4256ac65efda2cfae983315fd8cbe046bea91f2518" +checksum = "d0d17f59bb11c00a4339895f7319494ced6c329f119d809ed40b53d7f3b5dd1a" dependencies = [ "wayrs-client", ] [[package]] name = "wayrs-scanner" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21f171cbfea7942eb5a4648496730cc7757536fa5ac77774652a13b1570085c5" +checksum = "5e3601006a001e304701cd6fd22c09abb60918f5beaaa78fc47fa94032fd1203" dependencies = [ "proc-macro2", "quote", @@ -639,9 +639,9 @@ dependencies = [ [[package]] name = "wayrs-utils" -version = "0.16.1" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740897523a62aea856fae0bcb7a6a11773af2e5aec94808d6e3716e3c8a6b81d" +checksum = "f1f13c8fddab7c554a3e4c680dbb6a117e81eeabe7f0eba37bf02d74b2bb6b0f" dependencies = [ "libc", "memmap2", @@ -653,9 +653,9 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] @@ -726,9 +726,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index ac5d5ef..5594964 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ signal-hook = { version = "0.3", default-features = false } toml = { version = "0.8", default-features = false, features = ["parse"] } wayrs-client = "1.0" wayrs-protocols = { version = "0.14", features = ["wlr-layer-shell-unstable-v1", "viewporter", "fractional-scale-v1"] } -wayrs-utils = { version = "0.16", features = ["cursor", "shm_alloc", "seats"] } +wayrs-utils = { version = "0.17", features = ["cursor", "shm_alloc", "seats"] } clap = { version = "4.3", default-features = false, features = ["derive", "std", "help", "usage"] } libc = "0.2" diff --git a/src/main.rs b/src/main.rs index 076d17b..598864a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,9 +43,11 @@ fn main() -> anyhow::Result<()> { let [sig_read, sig_write] = pipe(libc::O_NONBLOCK | libc::O_CLOEXEC)?; signal_hook::low_level::pipe::register(SIGUSR1, sig_write)?; - let (mut conn, globals) = Connection::connect_and_collect_globals()?; + let mut conn = Connection::connect()?; + conn.blocking_roundtrip()?; + let mut el = EventLoop::new(); - let mut state = State::new(&mut conn, &globals, &mut el, args.config.as_deref()); + let mut state = State::new(&mut conn, &mut el, args.config.as_deref()); conn.flush(IoMode::Blocking)?; el.add_on_idle(|ctx| { diff --git a/src/output.rs b/src/output.rs index d243d52..222245c 100644 --- a/src/output.rs +++ b/src/output.rs @@ -1,6 +1,6 @@ use wayrs_client::global::{Global, GlobalExt}; -use wayrs_client::Connection; -use wayrs_client::{protocol::*, EventCtx}; +use wayrs_client::protocol::*; +use wayrs_client::{Connection, EventCtx}; use crate::state::State; diff --git a/src/state.rs b/src/state.rs index 72bf3f0..19d6434 100644 --- a/src/state.rs +++ b/src/state.rs @@ -8,7 +8,7 @@ use std::fmt::Display; use std::os::unix::io::{AsRawFd, RawFd}; use std::path::Path; -use wayrs_client::global::{GlobalExt, Globals, GlobalsExt}; +use wayrs_client::global::GlobalExt; use wayrs_client::proxy::Proxy; use wayrs_client::{Connection, EventCtx}; use wayrs_utils::cursor::{CursorImage, CursorShape, CursorTheme, ThemedPointer}; @@ -57,7 +57,6 @@ struct Pointer { impl State { pub fn new( conn: &mut Connection, - globals: &Globals, event_loop: &mut EventLoop, config_path: Option<&Path>, ) -> Self { @@ -73,38 +72,34 @@ impl State { .and_then(|cmd| StatusCmd::new(cmd).map_err(|e| error = Err(e)).ok()); conn.add_registry_cb(wl_registry_cb); - let wl_compositor = globals.bind(conn, 4..=5).unwrap(); + let wl_compositor = conn.bind_singleton(4..=5).unwrap(); - let cursor_theme = CursorTheme::new(conn, globals, wl_compositor); + let cursor_theme = CursorTheme::new(conn, wl_compositor); let default_cursor = cursor_theme .get_image(CursorShape::Default) .map_err(|e| error = Err(e.into())) .ok(); - let wm_info_provider = wm_info_provider::bind(conn, globals, &config.wm); + let wm_info_provider = wm_info_provider::bind(conn, &config.wm); wm_info_provider.register(event_loop); let mut this = Self { wl_compositor, - layer_shell: globals.bind(conn, 1..=4).unwrap(), - viewporter: globals.bind(conn, 1..=1).unwrap(), - fractional_scale_manager: globals.bind(conn, 1..=1).ok(), + layer_shell: conn.bind_singleton(1..=4).unwrap(), + viewporter: conn.bind_singleton(1).unwrap(), + fractional_scale_manager: conn.bind_singleton(1).ok(), - seats: Seats::bind(conn, globals), + seats: Seats::bind(conn), pointers: Vec::new(), - pending_outputs: globals - .iter() - .filter(|g| g.is::()) - .map(|g| PendingOutput::bind(conn, g)) - .collect(), + pending_outputs: Vec::new(), hidden: false, has_error: false, bars: Vec::new(), shared_state: SharedState { - shm: ShmAlloc::bind(conn, globals).unwrap(), + shm: ShmAlloc::bind(conn).unwrap(), config, status_cmd, blocks_cache: BlocksCache::default(), diff --git a/src/wm_info_provider.rs b/src/wm_info_provider.rs index b3c6618..eb8b51a 100644 --- a/src/wm_info_provider.rs +++ b/src/wm_info_provider.rs @@ -1,6 +1,5 @@ use std::any::Any; -use wayrs_client::global::*; use wayrs_client::Connection; use crate::config::WmConfig; @@ -52,12 +51,8 @@ pub trait WmInfoProvider { fn as_any(&mut self) -> &mut dyn Any; } -pub fn bind( - conn: &mut Connection, - globals: &Globals, - config: &WmConfig, -) -> Box { - if let Some(river) = RiverInfoProvider::bind(conn, globals, config) { +pub fn bind(conn: &mut Connection, config: &WmConfig) -> Box { + if let Some(river) = RiverInfoProvider::bind(conn, config) { return Box::new(river); } diff --git a/src/wm_info_provider/river.rs b/src/wm_info_provider/river.rs index 61b7e2b..9cf8c47 100644 --- a/src/wm_info_provider/river.rs +++ b/src/wm_info_provider/river.rs @@ -1,6 +1,5 @@ use std::ffi::CString; -use wayrs_client::global::*; use wayrs_client::proxy::Proxy; use wayrs_client::EventCtx; @@ -11,7 +10,7 @@ pub struct RiverInfoProvider { control: ZriverControlV1, output_statuses: Vec, max_tag: u8, - seat_status: SeatStatus, + mode: Option, } struct OutputStatus { @@ -23,33 +22,21 @@ struct OutputStatus { layout_name: Option, } -struct SeatStatus { - _status: ZriverSeatStatusV1, - mode: Option, -} - impl RiverInfoProvider { - pub fn bind( - conn: &mut Connection, - globals: &Globals, - config: &WmConfig, - ) -> Option { - let status_manager: ZriverStatusManagerV1 = globals.bind(conn, 1..=4).ok()?; - let wl_seat: WlSeat = globals.bind(conn, ..=5).ok()?; // river supports just one seat - let seat_status = - status_manager.get_river_seat_status_with_cb(conn, wl_seat, seat_status_cb); + pub fn bind(conn: &mut Connection, config: &WmConfig) -> Option { + let control = conn.bind_singleton(1).ok()?; + let status_manager: ZriverStatusManagerV1 = conn.bind_singleton(..=4).ok()?; + let wl_seat = conn.bind_singleton(..=5).ok()?; // river supports just one seat + status_manager.get_river_seat_status_with_cb(conn, wl_seat, seat_status_cb); if wl_seat.version() >= 5 { wl_seat.release(conn); } Some(Self { status_manager, - control: globals.bind(conn, 1).ok()?, + control, output_statuses: Vec::new(), max_tag: config.river.max_tag, - seat_status: SeatStatus { - _status: seat_status, - mode: None, - }, + mode: None, }) } @@ -112,7 +99,7 @@ impl WmInfoProvider for RiverInfoProvider { } fn get_mode_name(&self, _output: &Output) -> Option { - self.seat_status.mode.clone() + self.mode.clone() } fn click_on_tag( @@ -204,7 +191,7 @@ fn seat_status_cb(ctx: EventCtx) { if let zriver_seat_status_v1::Event::Mode(mode) = ctx.event { let river = ctx.state.shared_state.get_river().unwrap(); let mode = mode.to_string_lossy().into_owned(); - river.seat_status.mode = (mode != "normal").then_some(mode); + river.mode = (mode != "normal").then_some(mode); ctx.state.mode_name_updated(ctx.conn, None); } }