Skip to content

Fix IconView blank after cut/paste between parent-child folders#2806

Open
Dipanshusinghh wants to merge 1 commit into
elementary:mainfrom
Dipanshusinghh:fix/iconview-freeze-thaw-imbalance
Open

Fix IconView blank after cut/paste between parent-child folders#2806
Dipanshusinghh wants to merge 1 commit into
elementary:mainfrom
Dipanshusinghh:fix/iconview-freeze-thaw-imbalance

Conversation

@Dipanshusinghh

Copy link
Copy Markdown

Fixes #2801

Added child_notify_frozen boolean flag in IconView.vala and
AbstractTreeView.vala to ensure freeze_child_notify() and
thaw_child_notify() calls are always balanced, preventing IconView
from going permanently blank after cut/paste operations.

…alls

Fixes elementary#2801: When scrolling/resizing triggered freeze_child_notify() during a directory load (tree_frozen=true), thaw_child_notify() was skipped, leaving GTK's internal freeze counter unbalanced and the view permanently blank. Add child_notify_frozen boolean guard to ensure exactly one freeze/thaw pair per scroll event.

@jeremypw jeremypw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does seem to fix the issue for me, I am afraid. According to the documentation I have found there is no need to pair freeze_child_notify and thaw_child_notify calls (unlike object.freeze_notify and object.thaw_notify). When testing, make sure that you move a file between a parent folder and a child folder and then undo.

@Dipanshusinghh

Copy link
Copy Markdown
Author

Understod ! i will update this by today☺️

@jeremypw

Copy link
Copy Markdown
Contributor

You are right that the calls to the child_notify functions are unbalanced though. This whole area of the code is rather ugly and is a hack to improve the performance of IconView. Whether it is worth spending a lot of time making it more elegant is questionable as it will go away once we switch to Gtk4 dynamic views (unless it causes an issue).

@Dipanshusinghh

Copy link
Copy Markdown
Author

Thnks.
for the clarification since the documentation says pairing is not strictly necessary should I revert the boolean flag approach and instead focus on fixing the root cause of why thaw_child_notify() is being called without a prior freeze_child_notify()? Or would you prefer a different approach? Happy to update as per your suggestion

@jeremypw

jeremypw commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

@Dipanshusinghh You need to identify and fix the root cause of #2801 to complete this PR. If you want to improve the code for other reasons it would be better to open a separate PR for that.

The unpaired calls do not seem to be causing any actual issue do they?

Note that the issue only occurs with parent - child source and destination folders so the cause must have something to do with that. The cause could be quite obscure so I would try to determine (for example) whether the model for the view is being filled and not displayed by adding debugging messages or otherwise. Or maybe its a race between the view being unthawed and being drawn.

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.

IconView fails to refresh after reversing a cut/paste operation between parent and child folder

2 participants