Permalink
Browse files

Hide volume applet when media player is launched (more snappy-feeling…

…, keeping it open would be good if we could launch players in the background/hidden-mode but there's no support in MPRIS for this)
  • Loading branch information...
clefebvre committed Dec 21, 2011
1 parent a537a6b commit 0d40d640fc73b0eaa074fce46fd07125ddc47bb2
Showing with 7 additions and 6 deletions.
  1. +7 −6 js/ui/status/volume.js
View
@@ -618,26 +618,27 @@ Player.prototype = {
}
-function MediaPlayerLauncher(app) {
- this._init(app);
+function MediaPlayerLauncher(app, menu) {
+ this._init(app, menu);
}
MediaPlayerLauncher.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype,
- _init: function (app) {
+ _init: function (app, menu) {
PopupMenu.PopupBaseMenuItem.prototype._init.call(this, {});
this._app = app;
+ this._menu = menu;
this.label = new St.Label({ text: app.get_name() });
this.addActor(this.label);
this._icon = app.create_icon_texture(ICON_SIZE);
this.addActor(this._icon, { expand: false });
},
activate: function (event) {
- this._app.activate_full(-1, event.get_time());
-
+ this._menu.actor.hide();
+ this._app.activate_full(-1, event.get_time());
return true;
}
@@ -782,7 +783,7 @@ Indicator.prototype = {
for (var p=0; p<this._availablePlayers.length; p++){
let playerApp = this._availablePlayers[p];
- let menuItem = new MediaPlayerLauncher(playerApp);
+ let menuItem = new MediaPlayerLauncher(playerApp, this._launchPlayerItem.menu);
this._launchPlayerItem.menu.addMenuItem(menuItem);
}

0 comments on commit 0d40d64

Please sign in to comment.