[gnome-shell-extensions] launch-new-instance: Re-use original activate function
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] launch-new-instance: Re-use original activate function
- Date: Mon, 29 Sep 2014 13:32:25 +0000 (UTC)
commit 54e39c9779308643d77a14c16613d3ce478bad06
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Sep 27 13:28:00 2014 +0200
launch-new-instance: Re-use original activate function
Rather than re-implementing the function (and risk missing improvements
like the launch animation), call the original one as if the user had
middle-clicked the launcher.
extensions/launch-new-instance/extension.js | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/extensions/launch-new-instance/extension.js b/extensions/launch-new-instance/extension.js
index 7e34f31..fd97064 100644
--- a/extensions/launch-new-instance/extension.js
+++ b/extensions/launch-new-instance/extension.js
@@ -2,18 +2,14 @@ const AppDisplay = imports.ui.appDisplay;
var _onActivateOriginal = null;
-function _activate(button) {
- this.animateLaunch();
- this.app.open_new_window(-1);
- Main.overview.hide();
-}
-
function init() {
}
function enable() {
_activateOriginal = AppDisplay.AppIcon.prototype.activate;
- AppDisplay.AppIcon.prototype.activate = _activate;
+ AppDisplay.AppIcon.prototype.activate = function() {
+ _activateOriginal.call(this, 2);
+ };
}
function disable() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]