mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-21 14:55:43 +00:00
fix(tray): restore sidebar after cold-start minimized to tray (#1296)
This commit is contained in:
@@ -157,6 +157,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Fixed
|
||||
|
||||
### Tray — sidebar missing after cold start minimized to tray
|
||||
|
||||
**By [@cucadmuh](https://github.com/cucadmuh), PR [#1296](https://github.com/Psychotoxical/psysonic/pull/1296)**
|
||||
|
||||
* With **Start minimized to tray** enabled, opening the main window from the tray could leave the left sidebar menu invisible until a full app restart (seen on Linux tiling WMs such as Hyprland). The sidebar no longer uses a slide-in entrance animation that starts at `opacity: 0`; cold-start tray hide restores the original pause-and-hide path from PR #1271, and tray show again resumes rendering before `show()` without an extra `unminimize()` that could pop the window on tiling WMs.
|
||||
|
||||
### Playlist and radio custom covers blank
|
||||
|
||||
**By [@cucadmuh](https://github.com/cucadmuh), reported by VirtualWolf, PR [#1295](https://github.com/Psychotoxical/psysonic/pull/1295)**
|
||||
|
||||
@@ -53,14 +53,11 @@ fn on_second_instance<R: tauri::Runtime>(
|
||||
let window = app.get_webview_window("main").expect("no main window");
|
||||
// The window may have been hidden via the close-to-tray path,
|
||||
// which injects PAUSE_RENDERING_JS (sets `__psyHidden=true`,
|
||||
// pauses CSS animations). Tray-icon restore mirrors this with
|
||||
// RESUME_RENDERING_JS — second-launch restore must do the same,
|
||||
// otherwise the webview comes back with rendering still paused
|
||||
// and navigation looks blank (issue #497).
|
||||
let _ = window.eval(RESUME_RENDERING_JS);
|
||||
let _ = window.show();
|
||||
let _ = window.unminimize();
|
||||
let _ = window.set_focus();
|
||||
// pauses CSS animations). Tray restore uses `restore_main_window`
|
||||
// — second-launch restore must do the same, otherwise the webview
|
||||
// comes back with rendering still paused and navigation looks blank
|
||||
// (issue #497).
|
||||
let _ = crate::lib_commands::ui::mini::restore_main_window(&window);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,8 +169,12 @@ document.documentElement.style.removeProperty('--psy-anim-speed');
|
||||
})();
|
||||
"#;
|
||||
|
||||
/// Show the main window after startup splash paint, or pause rendering when the
|
||||
/// user chose "start minimized to tray" (flag set in `startup-splash-preflight.js`).
|
||||
/// Show the main window after startup splash paint, or pause rendering and hide
|
||||
/// when the user chose "start minimized to tray" (flag set in
|
||||
/// `startup-splash-preflight.js`).
|
||||
///
|
||||
/// The shell no longer uses entrance animations that start at `opacity: 0`, so
|
||||
/// pausing CSS here is safe on WebKitGTK tiling WMs (sidebar fix in #1296).
|
||||
pub(crate) fn eval_startup_main_window_visibility(window: &tauri::WebviewWindow) {
|
||||
let js = format!(
|
||||
"(function () {{
|
||||
|
||||
@@ -206,7 +206,7 @@ export default function Sidebar({
|
||||
|
||||
return (
|
||||
<>
|
||||
<aside className={`sidebar animate-slide-in ${isCollapsed ? 'collapsed' : ''}`}>
|
||||
<aside className={`sidebar ${isCollapsed ? 'collapsed' : ''}`}>
|
||||
<div className="sidebar-brand" aria-hidden>
|
||||
{isCollapsed
|
||||
? <PSmallLogo style={{ height: '32px', width: 'auto' }} />
|
||||
|
||||
Reference in New Issue
Block a user