对于raise-activated GNOME Shell 3.16 扩展,我正在尝试对该AppSwitcherPopup._finish
方法进行猴子补丁。与原始版本一样,修补版本调用this.parent
:
function _modifiedFinish(timestamp) {
// ...monkey-patched code...
this.parent(timestamp);
}
function enable() {
_originalFinish = AltTab.AppSwitcherPopup.prototype._finish;
AltTab.AppSwitcherPopup.prototype._finish = _modifiedFinish;
}
(完整代码)
但是我在控制台中得到了这个堆栈跟踪(来自运行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
在这种情况下,SwitcherPopup._keyReleaseEvent
正在调用this
,并且this
应该是子类的一个实例AppSwitcherPopup
。我相信this.parent
在打补丁后应该是一样的——为什么它现在试图打电话给调用者?就此而言,为什么不成功?
我查找了生成的GJS 代码this.parent
,但我无法完全发现缺少的内容。