fix: release the screensaver when leaving the last server while playing

Leaving the browsed server for the login screen stopped the player but
never updated the screensaver inhibit, and stop_player drops the events
that would have. The playback reset from switch_server is now a helper
that also syncs the inhibit, used for both paths, so logging in again
starts without the old queue's pause, position or restore state.

Bumps the version to 0.10.2.
This commit is contained in:
Ansho Rei
2026-11-06 23:44:50 +01:00
parent f03374b585
commit c6944041ea
5 changed files with 35 additions and 18 deletions
+6
View File
@@ -2,6 +2,12 @@
One section per version, newest first.
## v0.10.2 (2026-11-06)
### Bug fixes
- Leaving the last logged-in server while music plays, by logging out, forgetting it or a turned-down saved login, lets the screensaver run again on the login screen. Logging in after that starts with no leftover pause, position or restore state from the old queue.
## v0.10.1 (2026-11-06)
### Features
Generated
+1 -1
View File
@@ -4385,7 +4385,7 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
[[package]]
name = "remus"
version = "0.10.1"
version = "0.10.2"
dependencies = [
"anyhow",
"directories",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "remus"
version = "0.10.1"
version = "0.10.2"
edition = "2024"
license = "MIT"
@@ -20,6 +20,7 @@
</supports>
<content_rating type="oars-1.1"/>
<releases>
<release version="0.10.2" date="2026-11-06"/>
<release version="0.10.1" date="2026-11-06"/>
<release version="0.10.0" date="2026-11-06"/>
<release version="0.9.1" date="2026-11-06"/>
+26 -16
View File
@@ -704,19 +704,7 @@ impl App {
fn switch_server(&mut self, client: Client) {
if self.client.is_some() {
self.save_queue();
self.stop_player();
self.clear_queue();
self.queue_sel = 0;
self.position = 0.0;
self.duration = 0.0;
self.paused = false;
self.held = false;
self.scrobbled = false;
self.now_playing_due = false;
self.restoring = None;
self.art_shown = None;
self.flip_timer.stop();
self.ui.set_np_flip_out(false);
self.reset_playback();
}
log::info!("browsing {} on {}", client.user(), client.base());
self.enter_browse(client);
@@ -725,6 +713,30 @@ impl App {
self.sync_inhibit();
}
/// Stops the player and empties the queue with everything kept about it,
/// so the next server starts clean. The player's own events would
/// otherwise update the screen and the screensaver inhibit, but
/// stop_player drops them, so both are done here.
fn reset_playback(&mut self) {
self.stop_player();
self.clear_queue();
self.queue_sel = 0;
self.position = 0.0;
self.duration = 0.0;
self.paused = false;
self.held = false;
self.scrobbled = false;
self.now_playing_due = false;
self.restoring = None;
self.art_shown = None;
self.art_waiting = false;
self.flip_timer.stop();
self.ui.set_np_flip_out(false);
self.render_player();
self.sync_queue(true);
self.sync_inhibit();
}
fn clear_queue(&mut self) {
self.queue.clear();
self.order.clear();
@@ -910,11 +922,9 @@ impl App {
if keep_queue {
self.save_queue();
}
self.stop_player();
self.clear_queue();
self.reset_playback();
self.client = None;
self.checking_login = false;
self.render_player();
}
/// The server turned down the saved login of the browsed server: log it