Skip to content

WIP: General: Rework grid resize management

Rastersoft requested to merge rework_grid_resize_management into master

In the old code, the desktopManager object just waited in an idle task to know when the grids were ready to be populated. This is an ugly hack.

The third patch, which is the main one, uses directly the allocation-changed signal from each grid to detect when it is ready. This change also allows to separate the grid resize and recreation operation from the file list reading and the layout of icons, allowing to do them separately and independently. This greatly speeds up the repaint of the icons and reduces the flicker when new files are added to the desktop, or old ones are deleted or moved.

The second patch modifies the fileItem to allow to reuse fileItems even in the case of its actor being destroyed. This is a must because the checks added in desktopGrid to remove the actor before destroying the grid aren't enough. To do so, it recreates the actor inside the fileItem when the previous one has been destroyed. Also, he fourth patch improves this by recreating the actor only on-demand, greatly reducing the resources when the actor was destroyed previously to the destruction of the fileItem itself.

The first patch ensures that destroying the grid leaves it in a consistent state. Also it is a must before applying the third one.

Finally, the fifth patch takes advantage of these changes to partially fix #58

(the fourth patch is just an optimization for a common case in patch three).

Edited by Carlos Soriano

Merge request reports