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.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user