CarterLi / iina

The modern video player for macOS with additional features and bug fixes.
https://iina.io
GNU General Public License v3.0
678 stars 29 forks source link

Window jumps off screen when opening audio files if you disable album art and use auto music mode #18

Closed ArttuLai closed 2 years ago

ArttuLai commented 2 years ago

System and IINA version:

Expected behavior: When I open an audio file in Iina, the window doesn’t jump off screen and stays where it was last put, or respects the initial window position setting.

Actual behavior: When I open an audio file the window jumps off screen if I have automatic music mode turned on, and album art is disabled. If album art is expanded, the window behaves normally, and also if I’ve disabled automatic Music Mode in general.

Steps to reproduce:

  1. Enable Switch to "music mode" automatically when playing an audio file in Settings → General
  2. Get an MP3 file
  3. Quit Iina and choose to open the MP3 file in Iina
  4. You’ll notice that the window probably opens normally
  5. Now disable album art and repeat step 3
  6. Observe that the window jumps off screen or to a random position

Notes: There’s an open issue in the official Iina repo about this same issue, but I thought I’d open it here too as the development doesn’t seem active there. There’s also a lot more technical explanation in the original issue:

After IINA switches to the mini player, frame.origin.y is -50. This occurs in toggleVideoView in MiniPlayerWindowController.swift, which is called from switchToMiniPlayer in PlayerCore.swift.

Credit to @ErikMinekus

Screen recording:

How often does this happen? Always