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

locations: handle lack of dock manager in GetApps() #2295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

philipl
Copy link
Contributor

@philipl philipl commented Sep 23, 2024

This method may be called in situations where there is no dock manager, so handle it gracefully, rather than letting an exception propagate.

In some situations, this method may end up getting called in the context of another extension and the un-caught exception can terminate that extension.

@philipl
Copy link
Contributor Author

philipl commented Sep 23, 2024

Example stack traces (taken with extra instrumentation):

getApps@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/locations.js:1490:18
getRunningApps@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/locations.js:1507:12
get@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/docking.js:1890:59
get@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/docking.js:1891:73
_syncRunningApplications@resource:///org/gnome/shell/misc/introspect.js:80:26
IntrospectService/<@resource:///org/gnome/shell/misc/introspect.js:37:18
@resource:///org/gnome/shell/ui/init.js:21:20
getApps@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/locations.js:1490:18
getRunningApps@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/locations.js:1507:12
get@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/docking.js:1890:59
_syncRunningApplications@resource:///org/gnome/shell/misc/introspect.js:80:26
IntrospectService/<@resource:///org/gnome/shell/misc/introspect.js:43:18
_updateEntry@resource:///org/gnome/shell/gdm/authPrompt.js:326:27
setUser@resource:///org/gnome/shell/gdm/authPrompt.js:794:18
reset@resource:///org/gnome/shell/gdm/authPrompt.js:845:14
_onReset@resource:///org/gnome/shell/gdm/authPrompt.js:585:14
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
_onReset@resource:///org/gnome/shell/gdm/util.js:1367:14
@resource:///org/gnome/shell/ui/init.js:21:20

In the Unite extension (which then terminates):

getApps@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/locations.js:1490:18
getRunningApps@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/locations.js:1507:12
get@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/docking.js:1890:59
get@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/docking.js:1891:73
get focusApp@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/window.js:349:26
get focusApp@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/extension.js:38:5
_syncVisible@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/panel.js:583:22
activate@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/panel.js:572:10
onChange@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/handlers.js:289:24
add/feature._doActivate@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/handlers.js:300:7
activate/<@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/handlers.js:312:46
activate@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/handlers.js:312:19
activate@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/panel.js:776:21
enable@file:///home/philipl/.local/share/gnome-shell/extensions/[email protected]/extension.js:18:23
_callExtensionEnable@resource:///org/gnome/shell/ui/extensionSystem.js:267:38
_enableAllExtensions@resource:///org/gnome/shell/ui/extensionSystem.js:807:24
async*_sessionUpdated@resource:///org/gnome/shell/ui/extensionSystem.js:836:20
async*ExtensionManager/<@resource:///org/gnome/shell/ui/extensionSystem.js:49:18
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
_sync@resource:///org/gnome/shell/ui/sessionMode.js:211:14
popMode@resource:///org/gnome/shell/ui/sessionMode.js:182:14
_continueDeactivate@resource:///org/gnome/shell/ui/screenShield.js:588:30
deactivate/<@resource:///org/gnome/shell/ui/screenShield.js:579:44
finish@resource:///org/gnome/shell/gdm/authPrompt.js:905:13
finish@resource:///org/gnome/shell/ui/unlockDialog.js:931:26
deactivate@resource:///org/gnome/shell/ui/screenShield.js:579:26
_getLoginSession/<@resource:///org/gnome/shell/ui/screenShield.js:170:24
_callHandlers@resource:///org/gnome/gjs/modules/core/_signals.js:130:42
_emit@resource:///org/gnome/gjs/modules/core/_signals.js:119:10
_convertToNativeSignal@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:152:19
@resource:///org/gnome/shell/ui/init.js:21:20

This method may be called in situations where there is no dock manager, so
handle it gracefully, rather than letting an exception propagate.

In some situations, this method may end up getting called in the context of
another extension and the un-caught exception can terminate that extension.
@philipl
Copy link
Contributor Author

philipl commented Sep 24, 2024

Fixes #2297

@3v1n0
Copy link
Collaborator

3v1n0 commented Sep 24, 2024

Mhmh, the real bug is why the injection that is created https://github.com/micheleg/dash-to-dock/blob/master/docking.js#L1887C17-L1893 doesn't get disabled when the dock has been destroyed, since that's what it should happen.

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.

2 participants