Fix context menu null errors after wake from sleep - #99
Conversation
|
Thanks for the report. The initialization order change looks plausible, but could you share the full journalctl stack trace for the The other null guards appear broader than the reported error and may hide an initialization problem. In particular, prefs.js passes the rows and buttons guarded in panelModeGroup.js. Please also share the full stack trace for the preferences error and, if possible, the extension commit or version that was installed when it happened. Once we have those traces, we can narrow the PR to the guards that are actually needed. |
|
Here is the full journalctl stack trace for the The error originates in Regarding the preferences error, that was caused by a version mismatch during local testing. I was testing on an existing v63 install and had only copied I can remove the preferences guards and keep the PR focused only on the initialization order and |
|
Thanks for the stack trace and for explaining the preferences error. Please remove the preferences guards and the other optional chaining changes. The trace confirms that Install from source: Then logout and back in |
…troller On extension enable or wake from sleep, _panelController.enable() triggers an autohide check (_scheduleHide) that queries _panelInteractionIsBlocked(). Because _panelInteractionController.enable() was called afterwards, this._contextMenu was still null when menuIsOpen was accessed, throwing TypeError: can't access property "isOpen", this._contextMenu is null. Enabling _panelInteractionController and _startButtonController before _panelController ensures context menus are instantiated before the panel controller starts evaluating window focus and dodge events.
858fb9c to
0a6b1a6
Compare
|
The branch has been updated to keep only the initialization order change in I built and installed the extension from source via |
|
Thanks, the updated change looks good. The initialization order fixes the confirmed lifecycle issue without adding unnecessary null guards. Please update the PR description to remove references to the optional chaining and preferences guards, since those changes are no longer included. After that, I’m happy to merge it. |
|
Updated the PR description. Thanks! |
Occasionally after waking the device from sleep or unlocking the screen, GNOME Shell would throw:
TypeError: can't access property "isOpen", this._contextMenu is nullThis was caused by a lifecycle / initialization order issue during wake/enable where
_panelController.enable()ran before_panelInteractionController.enable(). Early window focus and dodge signals queriedinteractionIsBlockedandmenuIsOpenbeforethis._contextMenuhad been instantiated, leading to the crash.What this PR does:
extension.jsso interaction and start button controllers are ready before the panel controller starts handling window events.