Skip to content

Fix resolution change

Rastersoft requested to merge rastersoft/desktop-icons:resolution_change into master

When the screen resolution changes, whether it is due to connecting an external monitor to a laptop, or when changing the size of the window in a VirtualBox emulated screen, several errors happen. The first one is critical:

Object St.Widget (0x5557c3a01a70), has been already deallocated -
impossible to access to it. This might be caused by the fact that the
object has been destroyed from C code using something such as destroy(),
dispose(), or remove() vfuncs
== Stack trace for context 0x5557c1bcb4d0 ==

The fix consists in connecting the destroy signal of the actor in each desktopGrid object, and removing them from the list of grids every time the actor is destroyed.

The second error is simpler:

JS ERROR: TypeError: this._bgManager.backgroundActor is null
_onDestroy@desktop-icons@csoriano/desktopGrid.js:170:13
DesktopGrid</<@desktop-icons@csoriano/desktopGrid.js:89:45
_destroyDesktopIcons/<@desktop-icons@csoriano/desktopManager.js:100:59
_destroyDesktopIcons@desktop-icons@csoriano/desktopManager.js:100:9
_addDesktopIcons@desktop-icons@csoriano/desktopManager.js:81:9
DesktopManager</this._monitorsChangedId<@desktop-icons@csoriano/desktopManager.js:67:88
_emit@resource:///org/gnome/gjs/modules/signals.js:128:27
_monitorsChanged@resource:///org/gnome/shell/ui/layout.js:530:9
wrapper@resource:///org/gnome/gjs/modules/_legacy.js:82:22

The fix consists in checking whether the element is not null before trying to disconnect the signal.

Edited by Rastersoft

Merge request reports