Skip to content

desktopManager.js: Remove call to scheduleRelayoutChildren

Rastersoft requested to merge remove_unneeded_relayout into master

When the desktop is populated, desktopManager first destroys all the current grids; then it recreates the grids, reads the files and makes a call to scheduleRelayoutChildren().

But desktopGrid already has a way of calling scheduleRelayoutChildren: it calls it every time an allocation-changed signal is produced in the grid. This is useful when an element in the desktop resizes the grid (for example a dock), but that means that we are calling twice to scheduleRelayoutChildren(), one of that time when the file list isn't ready.

This patch rearranges the calls to fix this. Now it first reads the file list, and only then recreates the grids. When the grids trigger are finally realized, they trigger an allocation-changed signal, which automatically calls to scheduleRelayoutChildren(). This way only a single call is done, and only when the file list is ready.

Merge request reports