[GH-ISSUE #614] macOS: exec application and choose application window when using media controls #358

Closed
opened 2026-03-02 23:46:52 +03:00 by kerem · 3 comments
Owner

Originally created by @luiz290788 on GitHub (Nov 25, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/614

Describe the bug

There is an exec application that is open every time I open spotify_player on macOS.

Screenshot 2024-11-25 at 13 57 43

When I cmd+tab into that app I get the following message in the terminal:

Screenshot 2024-11-25 at 13 57 30

And when I use the media controls from my keyboard this window opens, the control works but I always have to close this annoying window:

Screenshot 2024-11-25 at 13 58 04

Is this expected?

To Reproduce

  • Install spotify_player using home brew (brew install spotify_player)
  • Authenticate
  • enable media control by setting enable_media_control = true in the ~/.config/spotify_player/app.toml
  • Start the application with spotify_player
  • verify the presence of the exec application
  • start playing a song
  • use the media controls to pause
  • verify the presence of a window asking "Where is use_default?"

Expected behaviour

No presence of the exec application and no windows when using the media controls.

Log and backtrace

2024-11-25T18:57:09.138979Z ERROR librespot_connect::spirc: ContextError: Error { kind: NotFound, error: StatusCode(404) }
2024-11-25T18:57:09.139029Z  INFO librespot_connect::spirc: No more tracks left in queue
2024-11-25T18:57:09.190636Z ERROR librespot_connect::spirc: ContextError: Error { kind: NotFound, error: StatusCode(404) }
2024-11-25T18:57:10.772865Z  INFO client_request{request=GetUserSavedTracks}: spotify_player::client: Successfully handled the client request, took: 3110ms
2024-11-25T18:57:12.673477Z  INFO spotify_player::client::handlers: Current context ID (None) is different from the expected ID (Some(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")))), update the context state
2024-11-25T18:57:12.673736Z  INFO client_request{request=GetContext(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")))}: spotify_player::client: Get playlist context: spotify:playlist:37i9dQZF1DZ06evO00jzcA
2024-11-25T18:57:12.836410Z  INFO client_request{request=GetContext(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")))}: spotify_player::client: Successfully handled the client request, took: 162ms
2024-11-25T18:57:48.932394Z  INFO spotify_player::media_control: Got a media control event: Toggle
2024-11-25T18:57:49.035371Z  INFO client_request{request=Player(ResumePause)}: spotify_player::client: Successfully handled the client request, took: 102ms
2024-11-25T18:57:51.506707Z  INFO spotify_player::media_control: Got a media control event: Next
2024-11-25T18:57:51.596969Z  INFO librespot_connect::spirc: Not playing next track because there are no more tracks left in queue.
2024-11-25T18:57:51.612626Z  INFO client_request{request=Player(NextTrack)}: spotify_player::client: Successfully handled the client request, took: 105ms
2024-11-25T18:57:53.741228Z  INFO librespot_playback::player: Loading <I Was Made For Lovin' You> with Spotify URI <spotify:track:07q0QVgO56EorrSGHC48y3>
2024-11-25T18:57:53.807040Z  INFO client_request{request=Player(StartPlayback(Context(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")), Some(Uri("spotify:track:07q0QVgO56EorrSGHC48y3"))), None))}: spotify_player::client: Successfully handled the client request, took: 291ms
2024-11-25T18:57:54.003611Z  INFO librespot_playback::player: <I Was Made For Lovin' You> (271240 ms) loaded
2024-11-25T18:57:54.004188Z  INFO spotify_player::streaming: Got a new player event: Changed { track_id: TrackId("07q0QVgO56EorrSGHC48y3") }
2024-11-25T18:57:54.004275Z  INFO spotify_player::streaming: Got a new player event: Playing { track_id: TrackId("07q0QVgO56EorrSGHC48y3"), position_ms: 0 }
2024-11-25T18:57:54.187577Z  INFO librespot_connect::spirc: Resolved 50 tracks from <"spotify:playlist:37i9dQZF1DZ06evO00jzcA">
2024-11-25T18:57:56.919858Z  INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: Successfully handled the client request, took: 163ms
2024-11-25T18:58:06.052689Z ERROR spotify_player::client: Encountered an error when updating the playback state: http error: request: error sending request for url (https://api.spotify.com/v1/me/player)
2024-11-25T19:01:55.107408Z  INFO librespot_playback::player: Loading <Rock And Roll All Nite> with Spotify URI <spotify:track:6KTv0Z8BmVqM7DPxbGzpVC>
2024-11-25T19:01:55.297794Z  INFO librespot_playback::player: <Rock And Roll All Nite> (168840 ms) loaded
2024-11-25T19:02:24.679655Z  INFO spotify_player::streaming: Got a new player event: EndOfTrack { track_id: TrackId("07q0QVgO56EorrSGHC48y3") }
2024-11-25T19:02:24.679855Z  INFO spotify_player::streaming: Got a new player event: Changed { track_id: TrackId("6KTv0Z8BmVqM7DPxbGzpVC") }
2024-11-25T19:02:24.680080Z  INFO spotify_player::streaming: Got a new player event: Playing { track_id: TrackId("6KTv0Z8BmVqM7DPxbGzpVC"), position_ms: 0 }
2024-11-25T19:02:26.475525Z  INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: Successfully handled the client request, took: 203ms
2024-11-25T19:02:38.102062Z ERROR spotify_player::client: Encountered an error when updating the playback state: Application 'com.apple.Finder' can only be set once.

Screenshots

See screenshots in the description.

Environment

  • OS: macOS
  • Application version: spotify_player 0.20.1
Originally created by @luiz290788 on GitHub (Nov 25, 2024). Original GitHub issue: https://github.com/aome510/spotify-player/issues/614 **Describe the bug** There is an exec application that is open every time I open `spotify_player` on macOS. ![Screenshot 2024-11-25 at 13 57 43](https://github.com/user-attachments/assets/464d3d4d-c611-41fa-b3b6-88e1c8e9cc88) When I cmd+tab into that app I get the following message in the terminal: ![Screenshot 2024-11-25 at 13 57 30](https://github.com/user-attachments/assets/600ca69a-ec82-43f0-8476-3f99f2596452) And when I use the media controls from my keyboard this window opens, the control works but I always have to close this annoying window: ![Screenshot 2024-11-25 at 13 58 04](https://github.com/user-attachments/assets/3f73f9d9-7ef1-4481-9101-aba629a86973) Is this expected? **To Reproduce** - Install `spotify_player` using home brew (`brew install spotify_player`) - Authenticate - enable media control by setting `enable_media_control = true` in the `~/.config/spotify_player/app.toml` - Start the application with `spotify_player` - verify the presence of the `exec` application - start playing a song - use the media controls to pause - verify the presence of a window asking "Where is use_default?" **Expected behaviour** No presence of the `exec` application and no windows when using the media controls. **Log and backtrace** ``` 2024-11-25T18:57:09.138979Z ERROR librespot_connect::spirc: ContextError: Error { kind: NotFound, error: StatusCode(404) } 2024-11-25T18:57:09.139029Z INFO librespot_connect::spirc: No more tracks left in queue 2024-11-25T18:57:09.190636Z ERROR librespot_connect::spirc: ContextError: Error { kind: NotFound, error: StatusCode(404) } 2024-11-25T18:57:10.772865Z INFO client_request{request=GetUserSavedTracks}: spotify_player::client: Successfully handled the client request, took: 3110ms 2024-11-25T18:57:12.673477Z INFO spotify_player::client::handlers: Current context ID (None) is different from the expected ID (Some(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")))), update the context state 2024-11-25T18:57:12.673736Z INFO client_request{request=GetContext(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")))}: spotify_player::client: Get playlist context: spotify:playlist:37i9dQZF1DZ06evO00jzcA 2024-11-25T18:57:12.836410Z INFO client_request{request=GetContext(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")))}: spotify_player::client: Successfully handled the client request, took: 162ms 2024-11-25T18:57:48.932394Z INFO spotify_player::media_control: Got a media control event: Toggle 2024-11-25T18:57:49.035371Z INFO client_request{request=Player(ResumePause)}: spotify_player::client: Successfully handled the client request, took: 102ms 2024-11-25T18:57:51.506707Z INFO spotify_player::media_control: Got a media control event: Next 2024-11-25T18:57:51.596969Z INFO librespot_connect::spirc: Not playing next track because there are no more tracks left in queue. 2024-11-25T18:57:51.612626Z INFO client_request{request=Player(NextTrack)}: spotify_player::client: Successfully handled the client request, took: 105ms 2024-11-25T18:57:53.741228Z INFO librespot_playback::player: Loading <I Was Made For Lovin' You> with Spotify URI <spotify:track:07q0QVgO56EorrSGHC48y3> 2024-11-25T18:57:53.807040Z INFO client_request{request=Player(StartPlayback(Context(Playlist(PlaylistId("37i9dQZF1DZ06evO00jzcA")), Some(Uri("spotify:track:07q0QVgO56EorrSGHC48y3"))), None))}: spotify_player::client: Successfully handled the client request, took: 291ms 2024-11-25T18:57:54.003611Z INFO librespot_playback::player: <I Was Made For Lovin' You> (271240 ms) loaded 2024-11-25T18:57:54.004188Z INFO spotify_player::streaming: Got a new player event: Changed { track_id: TrackId("07q0QVgO56EorrSGHC48y3") } 2024-11-25T18:57:54.004275Z INFO spotify_player::streaming: Got a new player event: Playing { track_id: TrackId("07q0QVgO56EorrSGHC48y3"), position_ms: 0 } 2024-11-25T18:57:54.187577Z INFO librespot_connect::spirc: Resolved 50 tracks from <"spotify:playlist:37i9dQZF1DZ06evO00jzcA"> 2024-11-25T18:57:56.919858Z INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: Successfully handled the client request, took: 163ms 2024-11-25T18:58:06.052689Z ERROR spotify_player::client: Encountered an error when updating the playback state: http error: request: error sending request for url (https://api.spotify.com/v1/me/player) 2024-11-25T19:01:55.107408Z INFO librespot_playback::player: Loading <Rock And Roll All Nite> with Spotify URI <spotify:track:6KTv0Z8BmVqM7DPxbGzpVC> 2024-11-25T19:01:55.297794Z INFO librespot_playback::player: <Rock And Roll All Nite> (168840 ms) loaded 2024-11-25T19:02:24.679655Z INFO spotify_player::streaming: Got a new player event: EndOfTrack { track_id: TrackId("07q0QVgO56EorrSGHC48y3") } 2024-11-25T19:02:24.679855Z INFO spotify_player::streaming: Got a new player event: Changed { track_id: TrackId("6KTv0Z8BmVqM7DPxbGzpVC") } 2024-11-25T19:02:24.680080Z INFO spotify_player::streaming: Got a new player event: Playing { track_id: TrackId("6KTv0Z8BmVqM7DPxbGzpVC"), position_ms: 0 } 2024-11-25T19:02:26.475525Z INFO client_request{request=GetCurrentUserQueue}: spotify_player::client: Successfully handled the client request, took: 203ms 2024-11-25T19:02:38.102062Z ERROR spotify_player::client: Encountered an error when updating the playback state: Application 'com.apple.Finder' can only be set once. ``` **Screenshots** See screenshots in the description. **Environment** - OS: macOS - Application version: spotify_player 0.20.1
kerem 2026-03-02 23:46:52 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@luiz290788 commented on GitHub (Nov 25, 2024):

This app only appears when the media control is enabled. I updated the steps to reproduce with that

<!-- gh-comment-id:2499237938 --> @luiz290788 commented on GitHub (Nov 25, 2024): This app only appears when the media control is enabled. I updated the steps to reproduce with that
Author
Owner

@luiz290788 commented on GitHub (Nov 25, 2024):

I guess I found the reason I'm seeing this app

MacOS and Windows require an open window to listen to OS media event. As a result, spotify_player needs to spawn an invisible window on startup, which may steal focus from the running terminal. To interact with spotify_player, which is run on the terminal, user will need to re-focus the terminal. Because of this extra re-focus step, the media control support is disabled by default on MacOS and Windows to avoid possible confusion for first-time users.

But is there a way to do that without requesting the "Where is use_default?" window? That is super annoying.

<!-- gh-comment-id:2499243805 --> @luiz290788 commented on GitHub (Nov 25, 2024): I guess I found the reason I'm seeing this app > MacOS and Windows require an open window to listen to OS media event. As a result, spotify_player needs to spawn an invisible window on startup, which may steal focus from the running terminal. To interact with spotify_player, which is run on the terminal, user will need to re-focus the terminal. Because of this extra re-focus step, the media control support is disabled by default on MacOS and Windows to avoid possible confusion for first-time users. But is there a way to do that without requesting the "Where is use_default?" window? That is super annoying.
Author
Owner

@luiz290788 commented on GitHub (Nov 25, 2024):

Ok, I found this.

Is there anyway to do that without having to keep this application open?

<!-- gh-comment-id:2499249148 --> @luiz290788 commented on GitHub (Nov 25, 2024): Ok, I found [this](https://github.com/aome510/spotify-player/issues/254). Is there anyway to do that without having to keep this application open?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#358
No description provided.