For the raise-activated GNOME Shell 3.16 extension I'm trying to monkey-patch the AppSwitcherPopup._finish
method. Like the original, the patched version calls this.parent
:
function _modifiedFinish(timestamp) {
// ...monkey-patched code...
this.parent(timestamp);
}
function enable() {
_originalFinish = AltTab.AppSwitcherPopup.prototype._finish;
AltTab.AppSwitcherPopup.prototype._finish = _modifiedFinish;
}
But I get this stack trace in the console (from running gnome-shell --replace
):
(gnome-shell:24452): Gjs-WARNING **: JS ERROR: TypeError: The method '_keyReleaseEvent' is not on the superclass
_parent@resource:///org/gnome/gjs/modules/lang.js:129
_modifiedFinish@/home/lastorset/.local/share/gnome-shell/extensions/Alt_Tab_Mod_Only_Raise_Activated_Window@dsboger.com.br/extension.js:34
SwitcherPopup<._keyReleaseEvent@resource:///org/gnome/shell/ui/switcherPopup.js:199
wrapper@resource:///org/gnome/gjs/modules/lang.js:169
In this case, SwitcherPopup._keyReleaseEvent
is calling this
, and this
should be an instance of the AppSwitcherPopup
subclass. I believe this.parent
should be the same after patching—why is it now trying to call the caller? And for that matter, why doesn't that succeed?
I looked up the GJS code that generated this.parent
, but I can't quite spot what's missing.