fix: Lyrics window did not go back to the correct position when automatically showing back for docked mode

This commit is contained in:
Zhe Fang
2025-11-12 08:37:57 -05:00
parent 607cbbe908
commit 44a1f0a809

View File

@@ -369,7 +369,7 @@ namespace BetterLyrics.WinUI3.Helper
{
_setLyricsWindowVisibilityByPlayingStatusTimer ??= dispatcherQueue.CreateTimer();
_setLyricsWindowVisibilityByPlayingStatusTimer.Debounce(() =>
_setLyricsWindowVisibilityByPlayingStatusTimer.Debounce(async () =>
{
var window = GetWindowByWindowType<LyricsWindow>();
if (window == null) return;
@@ -389,6 +389,12 @@ namespace BetterLyrics.WinUI3.Helper
SetIsWorkArea<LyricsWindow>(true);
}
OpenOrShowWindow<LyricsWindow>();
if (_liveStatesService.LiveStates.LyricsWindowStatus.IsWorkArea)
{
UpdateWorkArea<LyricsWindow>();
await Task.Delay(300);
MoveAndResize<LyricsWindow>(_liveStatesService.LiveStates.LyricsWindowStatus.GetWindowBoundsWhenWorkArea());
}
}
}, Constants.Time.DebounceTimeout);
}