Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changes for review https://extensions.gnome.org/review/49525 #211

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion [email protected]/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Adw from 'gi://Adw';
import GLib from 'gi://GLib';
import Gio from 'gi://Gio';
import * as Io from './io.js';
import Soup from 'gi://Soup?version=3.0';
import Soup from 'gi://Soup';
import * as Convert from './convertCharset.js';

const SETTING_USE_MEDIA_KEYS = 'use-media-keys';
Expand Down
18 changes: 14 additions & 4 deletions [email protected]/radioMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ const MediaKeysInterface = '<node> \
</signal> \
</interface> \
</node>';
const MediaKeysProxy = Gio.DBusProxy.makeProxyWrapper(MediaKeysInterface);
const Clipboard = St.Clipboard.get_default();

let RadioMenuButton = GObject.registerClass(
class RadioMenuButton extends PanelMenu.Button {
Expand Down Expand Up @@ -233,7 +231,10 @@ let RadioMenuButton = GObject.registerClass(
this._mediaKeysProxy.GrabMediaPlayerKeysRemote('GSE Radio', 0);
}
else {
new MediaKeysProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
if(!this.MediaKeysProxy) {
this.MediaKeysProxy = Gio.DBusProxy.makeProxyWrapper(MediaKeysInterface);
}
new this.MediaKeysProxy(Gio.DBus.session, BUS_NAME, OBJECT_PATH,
(proxy, error) => {
if (error) {
global.log(error.message);
Expand Down Expand Up @@ -295,7 +296,10 @@ let RadioMenuButton = GObject.registerClass(
}

_copyTagToClipboard() {
Clipboard.set_text(St.ClipboardType.CLIPBOARD, this.player._getTag());
if(!this.Clipboard) {
this.Clipboard = St.Clipboard.get_default();
}
this.Clipboard.set_text(St.ClipboardType.CLIPBOARD, this.player._getTag());
}

_onVolumeSliderValueChanged(actor, event) {
Expand Down Expand Up @@ -559,6 +563,12 @@ let RadioMenuButton = GObject.registerClass(
if (this.player !== null) {
this.player._disconnectSourceBus();
}
if(this.MediaKeysProxy !== null) {
this.MediaKeysProxy = null;
}
if(this.Clipboard != null ){
this.Clipboard = null;
}
super.destroy();
}

Expand Down