Repository navigation
feat(gnome-extension): show the panel only while YourTune runs, with show window and quit - #32
Conversation
…show window and quit The panel follows YourTune's org.mpris.MediaPlayer2.YourTune bus name instead of polling the API Server: the icon appears and connects when YourTune starts, and goes away when it quits, so there is no "not reachable" screen or retry loop while YourTune is closed. Since YourTune now drops its tray icon once the mini player connects, the card gets the tray menu's show window and quit, through POST /window/show and POST /quit, and falls back to raising the window or hides the quit button on YourTune 1.4.1 and older.
bercedev
left a comment
There was a problem hiding this comment.
looks good, 13/13 here and shexli is clean on the packed files (it only flags .gitignore, tests and tools, which pack.sh leaves out)
on your question: fine to depend on the shortcuts plugin. it's on by default and it's what gives yourtune its media keys and MPRIS on linux, so someone with it off already has no media controls anywhere. no extra bus name for now
one thing before merge: could you add a changelog line under #### Unreleased → Features, something like
- GNOME Shell mini player shows only while YourTune runs, with show window and quit, thanks to @sungyongcho ([#32](https://github.com/robotlog/YourTune/pull/32)).
we keep each PR's line in its own squash commit
|
one more small change in 49272a0: the changelog line credits it as "by @sungyongcho" instead of "thanks to", since it's my own work rather than a report or a port. happy to switch it back if you'd rather keep "thanks to" for contributors. |
Part 1 of #30, on top of #31.
Changes
org.mpris.MediaPlayer2.YourTunewithGio.bus_watch_name. When the name appears, the icon shows and the client connects; when it goes away, the menu closes, the icon hides and the client stops. While YourTune is closed there is no "not reachable" screen and no retry loop. The client's newstoppedstatus also cancels a pending/authif YourTune quits while its dialog is open.POST /window/showandPOST /quit. The artwork goes through/window/showtoo. On YourTune 1.4.1 and older, show window falls back to raising the window or launching the app as before, and the quit button hides after a 404, like the mix button.127.0.0.1,localhostor::1in the preferences isn't covered by a bus name on this machine, so the panel stays on for it as before.power-symbolic.svgfrompower-settings-new--rounded, throughtools/generate-icons.mjs. The README says when the icon shows and that the Shortcuts plugin provides the bus name.Screenshot
The card with YourTune running, with show window and quit at the end of the volume row:
Testing
In a nested GNOME Shell 50.1, with YourTune master (#31) running from source inside the nested session so its bus name is on the same session bus:
stopped, no reconnect timer.POST /window/show204, the menu closes and YourTune's window gets focus.POST /quit204, YourTune exits, the bus name goes away and the icon hides with nothing pending. A second launch brings it back.node --test 'extras/gnome-extension/tests/*.test.js': 13 pass. I don't haveshexlihere; the new code logs through_logFailure, so the ungatedconsole.errorcount doesn't change.Question
The bus name comes from the Shortcuts plugin (
registerMPRISin itsonMainLoad). With that plugin off, the panel never shows. Is that fine, or should the API Server own a small bus name of its own for this?