gnome-shell/js/ui
Carlos Garnacho 7095ef05e1 workspacesView: Skip relayouts during destruction
The WorkspacesView may be scheduled to be destroyed during
relayout, and despite that go through the allocate() vfunc.
When that happens, the ::destroy handler is called early,
so the WorkspacesView clears this._workspaces in result.
When vfunc_allocate() is called, various paths rely on the
workspaces array being still populated, which is not the
case.

The existing check at vfunc_allocate() for the WorkspacesView
having no children is insufficient, since children are destroyed
as a result, not beforehand.

This results in the following warnings when going out of
overview:

JS ERROR: TypeError: workspace is undefined
_getSpacing@resource:///org/gnome/shell/ui/workspacesView.js:218:13
vfunc_allocate@resource:///org/gnome/shell/ui/workspacesView.js:344:18
vfunc_allocate@resource:///org/gnome/shell/ui/overviewControls.js:223:33
removeWindow@resource:///org/gnome/shell/ui/workspace.js:856:29
addWindow/<.destroyId<@resource:///org/gnome/shell/ui/workspace.js:808:22
_updateWorkspacesViews@resource:///org/gnome/shell/ui/workspacesView.js:1023:38
prepareToEnterOverview@resource:///org/gnome/shell/ui/workspacesView.js:990:14
prepareToEnterOverview@resource:///org/gnome/shell/ui/overviewControls.js:740:33
gestureBegin@resource:///org/gnome/shell/ui/overviewControls.js:802:14
_gestureBegin@resource:///org/gnome/shell/ui/overview.js:409:33
_beginGesture@resource:///org/gnome/shell/ui/swipeTracker.js:601:14
_handleEvent@resource:///org/gnome/shell/ui/swipeTracker.js:173:26
@resource:///org/gnome/shell/ui/init.js:21:20

This always happens through the _updateWorkspacesViews() paths, so there
is a new WorkspacesView taking over and the one being destroyed should
silently go away.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6935
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2918>
2023-08-29 18:35:26 +00:00
..
components cleanup: Fixup wrong JSDoc comments 2023-08-09 15:10:38 +00:00
status status/backgroundApps: Close after activating app 2023-08-11 10:27:49 +00:00
accessDialog.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
altTab.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
animation.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
appDisplay.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
appFavorites.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
appMenu.js cleanup: Remove spaces in object literals 2023-08-09 15:10:37 +00:00
audioDeviceSelection.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
background.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
backgroundMenu.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
barLevel.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
boxpointer.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
calendar.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
checkBox.js cleanup: Remove spaces in object literals 2023-08-09 15:10:37 +00:00
closeDialog.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
components.js js: Port to modules 2023-08-06 13:02:49 +02:00
ctrlAltTab.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
dash.js dash: Move getAppFromSource() into static method 2023-08-20 01:30:55 +00:00
dateMenu.js js: Port to modules 2023-08-06 13:02:49 +02:00
dialog.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
dnd.js cleanup: Fixup wrong JSDoc comments 2023-08-09 15:10:38 +00:00
edgeDragAction.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
endSessionDialog.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
environment.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
extensionDownloader.js js: Port Config to ESM 2023-08-10 17:42:23 +00:00
extensionSystem.js js: Port Config to ESM 2023-08-10 17:42:23 +00:00
focusCaretTracker.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
grabHelper.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
ibusCandidatePopup.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
iconGrid.js iconGrid: Export zoomOutActor() 2023-08-25 16:21:03 +00:00
inhibitShortcutsDialog.js js: Port to modules 2023-08-06 13:02:49 +02:00
init.js init: Include the error stack in the context termination error message 2023-08-18 00:31:10 +00:00
kbdA11yDialog.js cleanup: Use consistent 4-space indent 2023-08-09 15:10:37 +00:00
keyboard.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
layout.js layout: Export PressureBarrier 2023-08-18 03:47:51 +00:00
lightbox.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
listModes.js listModes: Port listModes command to ES module 2023-08-05 22:16:23 +02:00
locatePointer.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
lookingGlass.js lookingGlass: Export the Inspector class 2023-08-17 19:32:42 +02:00
magnifier.js cleanup: Fixup wrong JSDoc comments 2023-08-09 15:10:38 +00:00
main.js main: Introduce global workspaces adjustment 2023-08-11 16:51:13 +00:00
messageList.js messageList: Allow dismissal via backspace 2023-08-16 14:04:47 +02:00
messageTray.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
modalDialog.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
mpris.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
notificationDaemon.js js: Port Config to ESM 2023-08-10 17:42:23 +00:00
osdMonitorLabeler.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
osdWindow.js osdWindow: Allow label and level to be null 2023-08-28 17:16:11 +00:00
overview.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
overviewControls.js overviewControls: Use new workspaces adjustment API 2023-08-11 16:51:13 +00:00
padOsd.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
pageIndicators.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
panel.js panel: Add extension hook to add quick settings items 2023-08-20 01:54:09 +02:00
panelMenu.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
pointerA11yTimeout.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
pointerWatcher.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
popupMenu.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
quickSettings.js quickSettings: Add getFirstItem() method 2023-08-20 01:54:09 +02:00
remoteSearch.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
ripples.js js: Port to modules 2023-08-06 13:02:49 +02:00
runDialog.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
screenShield.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
screenshot.js screenshot: Export showScreen*UI() functions 2023-08-09 15:22:55 +00:00
scripting.js js: Port Config to ESM 2023-08-10 17:42:23 +00:00
search.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
searchController.js cleanup: Remove spaces in object literals 2023-08-09 15:10:37 +00:00
sessionMode.js js: Port Config to ESM 2023-08-10 17:42:23 +00:00
shellDBus.js js: Port Config to ESM 2023-08-10 17:42:23 +00:00
shellEntry.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
shellMountOperation.js cleanup: Fixup wrong JSDoc comments 2023-08-09 15:10:38 +00:00
slider.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
swipeTracker.js cleanup: Fixup wrong JSDoc comments 2023-08-09 15:10:38 +00:00
switcherPopup.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
switchMonitor.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
unlockDialog.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
userWidget.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
welcomeDialog.js js: Port Config to ESM 2023-08-10 17:42:23 +00:00
windowAttentionHandler.js cleanup: Always use single quotes 2023-08-09 15:10:37 +00:00
windowManager.js windowManager: Drop AppSwitchAction 2023-08-25 00:42:27 +02:00
windowMenu.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
windowPreview.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
workspace.js cleanup: Fixup wrong JSDoc comments 2023-08-09 15:10:38 +00:00
workspaceAnimation.js workspaceAnimation: Sync progress with main adjustment 2023-08-11 16:51:13 +00:00
workspacesView.js workspacesView: Skip relayouts during destruction 2023-08-29 18:35:26 +00:00
workspaceSwitcherPopup.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00
workspaceThumbnail.js cleanup: Fixup wrong JSDoc comments 2023-08-09 15:10:38 +00:00
xdndHandler.js cleanup: Use type-safe comparisons 2023-08-09 15:10:38 +00:00