Skip to content

centered-placement: handle stale grid marks when clearing for a selection - #3901

Open
Kioubit wants to merge 1 commit into
linuxmint:masterfrom
Kioubit:master
Open

Kioubit wants to merge 1 commit into
linuxmint:masterfrom
Kioubit:master

Conversation

@Kioubit

@Kioubit Kioubit commented Nov 20, 2026

Copy link
Copy Markdown

nemo-desktop crashes on a desktop drag and drop when an icon is removed or re-created while the drag is active.

The drag and drop grid (container->details->dnd_grid) is created once at drag start (at nemo-icon-dnd.c:105-108 : pre_populate() over details->icons)
At drop time prep_selection() mutates that same grid (unmark_icon:1209, mark_position:1243,1294) and clear_grid_for_selection() collects the icons in the way with get_icon_at_grid_position(), which searches the live icon list and returns NULL when a marked cell has no icon. The collect loop assumes it never does and crashes.

Steps to reproduce (desktop icons, centered placement):

  1. Create a column of 3 desktop icons
  2. From a terminal run sleep 5; rm ~/Desktop/file.txt where file.txt is the second file in the column
  3. Within the five seconds of the sleep command drag another file between the first file and the second file in the column without releasing it
  4. Once file.txt disappears, release the drag

Related to issue #1775

…tion

nemo_centered_placement_grid_clear_grid_for_selection() collects the icons
sitting in the cells it needs for the drop and pushes them aside. The grid
(container->details->dnd_grid) is populated once at drag start from
container->details->icons, but at drop time the icons are looked up again
with get_icon_at_grid_position(), which searches the live icon list and
returns NULL when nothing is at a marked position.

Signed-off-by: Kioubit <[email protected]>
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.

1 participant