sakithb / media-controls

A media indicator for the Gnome shell.
MIT License
236 stars 36 forks source link

[WIP] Rewriting the internals of how the extension works #120

Closed sakithb closed 8 months ago

sakithb commented 9 months ago

Major changes

Todos

Issues

sakithb commented 9 months ago

@ChrisLauinger77 If you have some time on your hands to test this, I would love to hear your feedback

ChrisLauinger77 commented 9 months ago

@ChrisLauinger77 If you have some time on your hands to test this, I would love to hear your feedback

I am on vacation. Flying back next Saturday. So earliest Sunday I can have a look.

sakithb commented 9 months ago

@ChrisLauinger77 If you have some time on your hands to test this, I would love to hear your feedback

I am on vacation. Flying back next Saturday. So earliest Sunday I can have a look.

Sure

ChrisLauinger77 commented 8 months ago

My flight got delayed. I am home tomorrow not today.

sakithb commented 8 months ago

My flight got delayed. I am home tomorrow not today.

I've been using the new version for few days now, and it is very good. ~I think we should be good to release in a couple of days, also considering the fact many people are experiencing crashes.~

EDIT: I think it is good enough to release now and fix any upcoming bugs later. Fixing the crash issue is more important now. Don't you think?

Thesola10 commented 8 months ago

A word of warning: This version seems to be entirely unable to manage multiple players. When a new player is created (e.g. I open Lollypop after Firefox) all controls disappear, and toggling them displays controls for the previous player (Firefox) regardless of which is playing.

Additionally, there is no option anywhere to open a menu to switch between players like in the previous version.

Handling multiple players is absolutely required for day-to-day use, for instance GSConnect/KDE Connect will open a media player alongside any explicitly opened ones.

sakithb commented 8 months ago

A word of warning: This version seems to be entirely unable to manage multiple players. When a new player is created (e.g. I open Lollypop after Firefox) all controls disappear, and toggling them displays controls for the previous player (Firefox) regardless of which is playing.

Additionally, there is no option anywhere to open a menu to switch between players like in the previous version.

Handling multiple players is absolutely required for day-to-day use, for instance GSConnect/KDE Connect will open a media player alongside any explicitly opened ones.

You can handle multiple players in this version. There is a screenshot in the README of this branch. However I've only tested with Firefox, Chrome and Spotify all at once, maybe clapper and firefox.

Maybe something about lollypop makes the extension crash, so I will check that out and let you know. Besides that, in the popup menu all the active players are shown at the top and you can pin/switch between them.

sakithb commented 8 months ago

Screenshot from 2024-01-08 11-10-40

@Thesola10 I installed lollypop and launched it after firefox, and it worked fine. Do you see any errors in the journal? That would help me pin down the issue.

Thesola10 commented 8 months ago

Could be GSConnect causing the issue. Right now, relaunching the extension causes nothing to show up, leaving these errors: mediacontrols-journalctl-excerpt.log

There is also an attempt at reloading the extension in the logs, which breaks the settings view: image

Thesola10 commented 8 months ago

Addendum: the Settings breakage issue seems to also spontaneously occur without reloading the extension.

Thesola10 commented 8 months ago

Also, here's the very first error of its kind on session start:

janv. 08 11:09:00 SolaXBook gnome-shell[41333]: [Media Controls] Chosen player: undefined
janv. 08 11:09:00 SolaXBook gnome-shell[41333]: [Media Controls] Removing panel button
janv. 08 11:09:01 SolaXBook gnome-shell[41333]: g_source_remove: assertion 'tag > 0' failed
janv. 08 11:09:01 SolaXBook gnome-shell[41333]: [Media Controls] Chosen player: undefined
janv. 08 11:09:01 SolaXBook gnome-shell[41333]: [Media Controls] Removing panel button
janv. 08 11:09:01 SolaXBook gnome-shell[41333]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.Lollypop
janv. 08 11:09:01 SolaXBook gnome-shell[41333]: [Media Controls] Adding panel button
janv. 08 11:09:01 SolaXBook gnome-shell[41333]: [Media Controls] Error: Failed to call listener for property IsInvalid: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:387:25
                                                setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:350:22
                                                addPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:302:18
                                                callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                validatePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:87:14
                                                callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                @resource:///org/gnome/shell/ui/init.js:21:20                                               
Thesola10 commented 8 months ago

Do you have a prebuilt version of the extension that I could try by any chance? I want to rule out any build environment issues. I'm using Node and TypeScript from Nixpkgs in a temporary shell to build the extension.

I also ruled out any possible conflict with Dash to Panel as the same issue occurs with the extension disabled at session start. I'm running Shell 45.2.0 by the way.

sakithb commented 8 months ago

mediacontrols@cliffniff.github.com.shell-extension.zip Here is the build of the latest commit, try to start with a clean slate, uninstall mediacontrols and relogin, then install the file.

I am on the same gnome shell version, so we can rule any possibility of that causing issues. I think the old extension code might be conflicting with the new extension? Did you restart the shell after installing the extension?

sakithb commented 8 months ago

@Thesola10 Also if you want to build the extension, first run npm install inside the repo, then run mediacontrols.sh build to build or try mediacontrols.sh help for other commands. Im not sure if these steps or commands change for nix os.

Thesola10 commented 8 months ago

Installed your version, following your steps exactly, and this time the "Loaded" message from Media Controls never shows up, instead giving me these two messages:

janv. 08 11:42:18 SolaXBook gnome-shell[108996]: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
                                                   addPlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:331:20
                                                   initWatchProxy/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:304:22
                                                   _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                   _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                   _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                   @resource:///org/gnome/shell/ui/init.js:21:20
janv. 08 11:42:18 SolaXBook gnome-shell[108996]: [Media Controls] Error: Failed to call listener for property IsInvalid: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:105:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:47:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:453:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:410:22
                                                 addPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:353:18
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:115:25
                                                 validatePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:95:14
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:115:25
                                                 pollTillInitialized/this.pollSourceId</<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:80:26
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

And yep npm install + mediacontrols.sh build is exactly what I did on my end as well.

sakithb commented 8 months ago

Alright thanks, let me trace back the error.

Thesola10 commented 8 months ago

Oh, I have fractional scaling enabled, maybe this could be related? Then again the issue also occurs in my nested session, which doesn't (or rather can't) have fractional scaling.

sakithb commented 8 months ago

mediacontrols@cliffniff.github.com.shell-extension.zip Can you try this build and post the logs again.

sakithb commented 8 months ago

Oh, I have fractional scaling enabled, maybe this could be related? Then again the issue also occurs in my nested session, which doesn't (or rather can't) have fractional scaling.

I don't think that can be the cause.

Thesola10 commented 8 months ago

Here you go, the initial IsInvalid message is gone but these messages remain:

janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Adding player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Adding panel button
janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Added controls
janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Error: Failed to add player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 addPlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:308:18
                                                 async*initWatchProxy/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:263:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Adding panel button
janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Added controls
janv. 08 11:56:06 SolaXBook gnome-shell[124014]: [Media Controls] Error: Failed to call listener for property IsInvalid: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 addPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:303:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 validatePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:87:14
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 pollTillInitialized/this.pollSourceId</<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:73:26
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 11:56:17 SolaXBook gnome-shell[124014]: [Media Controls] Adding player: org.mpris.MediaPlayer2.Lollypop
janv. 08 11:56:17 SolaXBook gnome-shell[124014]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 11:56:17 SolaXBook gnome-shell[124014]: [Media Controls] Adding panel button
janv. 08 11:56:17 SolaXBook gnome-shell[124014]: [Media Controls] Added controls
janv. 08 11:56:17 SolaXBook gnome-shell[124014]: [Media Controls] Error: Failed to add player: org.mpris.MediaPlayer2.Lollypop Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 addPlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:308:18
                                                 async*initWatchProxy/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:263:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 11:56:19 SolaXBook gnome-shell[124014]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 11:56:19 SolaXBook gnome-shell[124014]: [Media Controls] Adding panel button
janv. 08 11:56:19 SolaXBook gnome-shell[124014]: [Media Controls] Added controls
janv. 08 11:56:19 SolaXBook gnome-shell[124014]: [Media Controls] Error: Failed to call listener for property IsInvalid: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 addPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:303:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 validatePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:87:14
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 pollTillInitialized/this.pollSourceId</<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:73:26
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 11:56:20 SolaXBook gnome-shell[124014]: g_source_remove: assertion 'tag > 0' failed
janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Adding panel button
janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Added controls
janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Error: Failed to call listener for property PlaybackStatus: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.Lollypop
janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Adding panel button
janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Added controls
janv. 08 11:56:20 SolaXBook gnome-shell[124014]: [Media Controls] Error: Failed to call listener for property IsInvalid: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 addPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:303:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 validatePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:87:14
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 11:56:21 SolaXBook gnome-shell[124014]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 11:56:21 SolaXBook gnome-shell[124014]: [Media Controls] Adding panel button
janv. 08 11:56:21 SolaXBook gnome-shell[124014]: [Media Controls] Added controls
janv. 08 11:56:21 SolaXBook gnome-shell[124014]: [Media Controls] Error: Failed to call listener for property PlaybackStatus: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:98:36
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20
sakithb commented 8 months ago

mediacontrols@cliffniff.github.com.shell-extension.zip @Thesola10 Can you see if this build fixes it.

Thesola10 commented 8 months ago

Yep, gave it a quick spin in a test session and it works! Now we're back to the issue above, where opening another player makes controls disappear and the popover only shows one player.

sakithb commented 8 months ago

Yep, gave it a quick spin in a test session and it works! Now we're back to the issue above, where opening another player makes controls disappear and the popover only shows one player.

Any errors in the log?

Thesola10 commented 8 months ago

Here's a Shell log with the new issue: newexcerpt.txt

Thesola10 commented 8 months ago

Playing around a bit causes the extension to almost fix itself, and switching between players updates the panel widget but not the popover, and when any player other than the first is selected the panel icons don't update when clicked.

sakithb commented 8 months ago

Playing around a bit causes the extension to almost fix itself, and switching between players updates the panel widget but not the popover

Thanks for the info, I will look into it in an hour or so.

ChrisLauinger77 commented 8 months ago

I updated my debian box to latest beta and it does not work for me at all:

[Media Controls] Chosen player: undefined
[Media Controls] Removing panel button
[Media Controls] Chosen player: org.mpris.MediaPlayer2.spotify
[Media Controls] Adding panel button
[Media Controls] Added icon
st_widget_get_theme_node called on the widget [0x564afae4f0a0 StBoxLayout:insensitive ("Africa - Slimenese - Africa")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564afd5884d0 StLabel:insensitive ("Africa - Slimenese - Africa")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564afae4f0a0 StBoxLayout:insensitive ("Africa - Slimenese - Africa ")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564afd5884d0 StLabel:insensitive ("Africa - Slimenese - Africa ")] which is not in the stage.
[Media Controls] Added label
[Media Controls] Error: Failed to call listener: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
updateWidgets@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PanelButton.js:115:36
PanelButton@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PanelButton.js:46:14
addPanelButton@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:449:25
setActivePlayer@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:406:22
addPlayer/<@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:353:18
callOnChangedListeners@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:115:25
validatePlayer@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:95:14
callOnChangedListeners@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:115:25
initPlayer/<@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:37:22
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
_convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
@resource:///org/gnome/shell/ui/init.js:21:20

[Media Controls] Chosen player: org.mpris.MediaPlayer2.spotify
[Media Controls] Adding panel button
[Media Controls] Added icon
st_widget_get_theme_node called on the widget [0x564afe779680 StBoxLayout:insensitive ("Africa - Slimenese - Africa")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564aff6211f0 StLabel:insensitive ("Africa - Slimenese - Africa")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564afe779680 StBoxLayout:insensitive ("Africa - Slimenese - Africa ")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564aff6211f0 StLabel:insensitive ("Africa - Slimenese - Africa ")] which is not in the stage.
[Media Controls] Added label
[Media Controls] Error: Failed to call listener: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
updateWidgets@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PanelButton.js:115:36
PanelButton@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PanelButton.js:46:14
addPanelButton@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:449:25
setActivePlayer@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:406:22
addPlayer/<@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:353:18
callOnChangedListeners@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:115:25
validatePlayer@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:95:14
callOnChangedListeners@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:115:25
pollTillInitialized/this.pollSourceId</<@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:80:26
@resource:///org/gnome/shell/ui/init.js:21:20

[Media Controls] Chosen player: org.mpris.MediaPlayer2.spotify
[Media Controls] Adding panel button
[Media Controls] Added icon
st_widget_get_theme_node called on the widget [0x564af726ad10 StBoxLayout:insensitive ("Africa - Slimenese - Africa")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564afcb6ef40 StLabel:insensitive ("Africa - Slimenese - Africa")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564af726ad10 StBoxLayout:insensitive ("Africa - Slimenese - Africa ")] which is not in the stage.
st_widget_get_theme_node called on the widget [0x564afcb6ef40 StLabel:insensitive ("Africa - Slimenese - Africa ")] which is not in the stage.
[Media Controls] Added label
[Media Controls] Error: Failed to call listener: Error: Expected an object of type ClutterActor for argument 'child' but got type undefined
updateWidgets@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PanelButton.js:115:36
PanelButton@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PanelButton.js:46:14
addPanelButton@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:449:25
setActivePlayer@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:406:22
callOnChangedListeners@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:115:25
initPlayer/<@file:///home/christian/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/PlayerProxy.js:37:22
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
_convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
@resource:///org/gnome/shell/ui/init.js:21:20

Ignoring length property that isn't a number at line 2875, col 24
Ignoring length property that isn't a number at line 2875, col 24
Ignoring length property that isn't a number at line 2875, col 24
ChrisLauinger77 commented 8 months ago

I updated to the version linked by @sakithb in this thread and this seems to work better, grafik

sakithb commented 8 months ago

I updated to the version linked by @sakithb in this thread and this seems to work better, grafik

That's great. What is the icon pack you are using? The "pin" icon is not being shown for you, maybe I should use a more common icon.

ChrisLauinger77 commented 8 months ago

I updated to the version linked by @sakithb in this thread and this seems to work better, grafik

That's great. What is the icon pack you are using? The "pin" icon is not being shown for you, maybe I should use a more common icon.

I use https://github.com/somepaulo/MoreWaita

I added in the old version the ability to open the settings. I miss it in the new version ...

Thesola10 commented 8 months ago

Ah, same as me. @ChrisLauinger77 please format your log dump using three backticks before and after

sakithb commented 8 months ago

I updated to the version linked by @sakithb in this thread and this seems to work better, grafik

That's great. What is the icon pack you are using? The "pin" icon is not being shown for you, maybe I should use a more common icon.

I use https://github.com/somepaulo/MoreWaita

I added in the old version the ability to open the settings. I miss it in the new version ...

open the settings through mouse actions?

sakithb commented 8 months ago

mediacontrols@cliffniff.github.com.shell-extension.zip @Thesola10 See if the bug is fixed with this build.

Thesola10 commented 8 months ago

does it match the latest commit here? I was about to build against 8b8700d

ChrisLauinger77 commented 8 months ago

I updated to the version linked by @sakithb in this thread and this seems to work better, grafik

That's great. What is the icon pack you are using? The "pin" icon is not being shown for you, maybe I should use a more common icon.

I use https://github.com/somepaulo/MoreWaita I added in the old version the ability to open the settings. I miss it in the new version ...

open the settings through mouse actions?

Not sure tbh. I think about it

sakithb commented 8 months ago

does it match the latest commit here? I was about to build against 8b8700d

yep

ChrisLauinger77 commented 8 months ago

Also the album is not in the Media info panel any more. v31 had it

Thesola10 commented 8 months ago

No dice, just prints this in a loop:

janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.Lollypop
janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Adding panel button
janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Added controls
janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Error: Failed to call listener for property IsInvalid: TypeError: app is null
                                                 addMenuPlayers@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:228:21
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:114:18
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 addPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:303:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 validatePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:87:14
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Adding panel button
janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Added controls
janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Error: Failed to call listener for property PlaybackStatus: TypeError: app is null
                                                 addMenuPlayers@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:205:17
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:114:18
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

Could be a weird interaction with GSConnect?? It worked in the test session

sakithb commented 8 months ago

No dice, just prints this in a loop:

janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.Lollypop
janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Adding panel button
janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Added controls
janv. 08 17:15:02 SolaXBook gnome-shell[306583]: [Media Controls] Error: Failed to call listener for property IsInvalid: TypeError: app is null
                                                 addMenuPlayers@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:228:21
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:114:18
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 addPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:303:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 validatePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:87:14
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Chosen player: org.mpris.MediaPlayer2.GSConnect.BobileNoteXAppleMusic
janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Adding panel button
janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Added controls
janv. 08 17:15:08 SolaXBook gnome-shell[306583]: [Media Controls] Error: Failed to call listener for property PlaybackStatus: TypeError: app is null
                                                 addMenuPlayers@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:205:17
                                                 updateWidgets@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:114:18
                                                 PanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PanelButton.js:45:14
                                                 addPanelButton@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:392:25
                                                 setActivePlayer@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/extension.js:355:22
                                                 callOnChangedListeners@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:103:25
                                                 initPlayer/<@file:///home/karim/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/helpers/shell/PlayerProxy.js:34:22
                                                 _callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
                                                 _emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
                                                 _convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
                                                 @resource:///org/gnome/shell/ui/init.js:21:20

Could be a weird interaction with GSConnect?? It worked in the test session

As I see it, it crashes when the extension cannot find an app that matches the mpris player, I can test and fix this with lollypop, gsconnect is understandable because it would not be an app. In any case I would make the extension use fallbacks if an app is not found.

sakithb commented 8 months ago

@Thesola10 can you try out the latest commit

Thesola10 commented 8 months ago

Works perfectly thanks! :D

Icon doesn't show up on panel for fallback though, can make it hard to perform the left click action

sakithb commented 8 months ago

Works perfectly thanks! :D

Icon doesn't show up on panel for fallback though, can make it hard to perform the left click action

It should show the fallback icon, now

ChrisLauinger77 commented 8 months ago

I updated to the version linked by @sakithb in this thread and this seems to work better, grafik

That's great. What is the icon pack you are using? The "pin" icon is not being shown for you, maybe I should use a more common icon.

I use https://github.com/somepaulo/MoreWaita I added in the old version the ability to open the settings. I miss it in the new version ...

open the settings through mouse actions?

yes mouse action is fine (I guess I would assign middle click)

sakithb commented 8 months ago

I will add a mouse action for that. I guess we are ready to release after that.

ChrisLauinger77 commented 8 months ago

I will add a mouse action for that. I guess we are ready to release after that.

nice thx. I already mentioned it yesterday - the album is not in popup menu any more (I did it in v31 over issue #40 ) grafik

Also in PanelButton.ts translation support is missing: line 256 "Unknown player" and line 456 "Unknown artist" Other than that - yes I guess its release-able

sakithb commented 8 months ago

@ChrisLauinger77 Yup I will add that. But I feel like it looks out of place, maybe there is a better way to do it. What do you think of adding it next to the artist separated with a /.

ChrisLauinger77 commented 8 months ago

@ChrisLauinger77 Yup I will add that. But I feel like it looks out of place, maybe there is a better way to do it. What do you think of adding it next to the artist separated with a /.

thanks man. yes i like the idea of adding it in the same line ... maybe before the release one more beta/rc when all features are in ?

sakithb commented 8 months ago

I released a new version, let me know if the album name next to the artist looks good, it still looks off to me, let me know your thoughts.

ChrisLauinger77 commented 8 months ago

I released a new version, let me know if the album name next to the artist looks good, it still looks off to me, let me know your thoughts. I think it looks good grafik BUT when no album is there there should be "Unknown album" (with translation support) OR no "/" sign grafik

sakithb commented 8 months ago

I released a new version, let me know if the album name next to the artist looks good, it still looks off to me, let me know your thoughts. I think it looks good grafik BUT when no album is there there should be "Unknown album" (with translation support) OR no "/" sign grafik

You are right, give me a minute. It would be better to show no album at all if there is none