Release Kaleido Desktop 0.1.0-beta.12
All checks were successful
Validate Kaleido Desktop / validate (push) Successful in 1m22s
All checks were successful
Validate Kaleido Desktop / validate (push) Successful in 1m22s
On Windows the miniplayer is now a window of its own (mini.rs, mini.html): a borderless window owned by the main one that the video moves into (VideoSurface::set_host swaps composition targets in one commit). Dragging moves the whole window, so video and controls move together with no edge flicker; release glides it to the nearest corner or the one it's flicked towards, remembered, and it follows the main window. Its page mirrors the player over events (mini:state / mini:action). Shown and hidden natively without activation, so the main window keeps focus. macOS keeps the in-page miniplayer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c3d2f4b6a7
commit
8ed44c2fe4
22 changed files with 871 additions and 26 deletions
|
|
@ -180,13 +180,29 @@ fn player<R: Runtime>(app: &AppHandle<R>) -> Result<Arc<Mpv>, String> {
|
|||
#[tauri::command]
|
||||
pub async fn player_init<R: Runtime>(app: AppHandle<R>, window: WebviewWindow<R>, options: Option<InitOptions>) -> Result<(), String> {
|
||||
let state = app.state::<PlayerState>();
|
||||
let mut guard = state.mpv.lock();
|
||||
if guard.is_none() {
|
||||
*guard = Some(create_player(&app, &window, &options.unwrap_or_default())?);
|
||||
{
|
||||
let mut guard = state.mpv.lock();
|
||||
if guard.is_none() {
|
||||
*guard = Some(create_player(&app, &window, &options.unwrap_or_default())?);
|
||||
}
|
||||
}
|
||||
// Outside the lock: creating a window waits on the UI thread.
|
||||
crate::mini::prepare(&app);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Moves the video into another window (the miniplayer's, mini.rs) or back to
|
||||
/// the main one. Off the UI thread only (it takes the player's locks).
|
||||
pub fn set_video_host<R: Runtime>(app: &AppHandle<R>, host: Option<isize>) -> Result<(), String> {
|
||||
let state = app.state::<PlayerState>();
|
||||
let mpv = state.mpv.lock().clone();
|
||||
let mut surface = state.surface.lock();
|
||||
match surface.as_mut() {
|
||||
Some(surface) => surface.set_host(host, mpv.as_deref()),
|
||||
None => Ok(()),
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn player_show<R: Runtime>(app: AppHandle<R>, window: WebviewWindow<R>, visible: bool) -> Result<(), String> {
|
||||
let state = app.state::<PlayerState>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue