Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dockmanager null #2148

Closed
wants to merge 2 commits into from
Closed

Conversation

smedir
Copy link
Contributor

@smedir smedir commented Feb 15, 2024

Dockmanager can be null, and this spams the log if desktopIconsIntegration class is initialized and used.

Dec 11: JS ERROR: TypeError: DockManager.getDefault() is null
get extension@file:///home//.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmai>
_sendMarginsToExtension@file:///home/
/.local/share/gnome-shell/extensions/dash-to-dock@m>
_sendMarginsToAll/<@file:///home//.local/share/gnome-shell/extensions/dash-to-dock@micxg>
_sendMarginsToAll@file:///home/
/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.>
_changedMargins/this._timedMarginsID<@file:///home/*/.local/share/gnome-shell/extensions/>
@resource:///org/gnome/shell/ui/init.js:21:20

desktopIconsIntegration class is initialized and called from the extension and really should not have any other dependencies other than the shell, it is meant to be used and can be used as is by any extension if called as is independently without modifications.

Dockmanager can be null, and this spams the log if desktopIconsIntegration class
is initialized and used.

desktopIconsIntegration class is initialized and called from the extension and
really should not have any other dependencies other than the shell,
it is meant to be used and can be used as is by any extension if called as is
independently without modifications.

Fix resource path for Extension
Copy link
Collaborator

@sergio-costas sergio-costas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are sensible. I think that they should be merged.

@sergio-costas
Copy link
Collaborator

@3v1n0 Can you review this, please? I think it's a good idea to merge it.

@smedir
Copy link
Contributor Author

smedir commented Mar 13, 2024

Please also see previous MR #2132

@vanvugt
Copy link
Collaborator

vanvugt commented Mar 19, 2024

Sounds like this should close #1444

@sergio-costas
Copy link
Collaborator

@vanvugt I don't have permissions to merge here. Can you do it, please?

@vanvugt
Copy link
Collaborator

vanvugt commented Mar 20, 2024

I was waiting for us to complete #2146 first, just in case this caused unnecessary conflicts.


const IDENTIFIER_UUID = '130cbc66-235c-4bd6-8571-98d2d8bba5e2';

export class DesktopIconsUsableAreaClass {
constructor() {
const Me = Extension.lookupByURL(import.meta.url);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes dash-to-dock to not load at all in GNOME 46:

(gnome-shell:21081): GNOME Shell-CRITICAL **: 13:59:17.826: Extension dash-to-dock@micxgx.gmail.com: TypeError: (intermediate value).lookupByURL is not a function

Stack trace:
  DesktopIconsUsableAreaClass@file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/desktopIconsIntegration.js:67:30
  DockManager@file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/docking.js:1658:40
  enable@file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/extension.js:11:23
  _callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:266:38
  loadExtension@resource:///org/gnome/shell/ui/extensionSystem.js:478:32
  async*_loadExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:786:24  async*_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:792:48
  _sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:827:20
  async*init@resource:///org/gnome/shell/ui/extensionSystem.js:76:14 
  _initializeUI@resource:///org/gnome/shell/ui/main.js:303:22
  start@resource:///org/gnome/shell/ui/main.js:175:11
  @resource:///org/gnome/shell/ui/init.js:12:47
  @resource:///org/gnome/shell/ui/init.js:21:20

Copy link
Contributor Author

@smedir smedir Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems the import form ./dependencies breaks it. The files have to be imported directly ? static function importByUrl()

The previous MR #2132 works perfectly. That also answers Marco Trevisan's question - I forgot why I imported the files directly. I can close this MR, I just have to figure out how to re-open #2132 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants