Refreshing the viewport from an extension
Hi!
I have just published an extension for annotating files and directories (here the Arch Linux PKGBUILD
). When an annotation is added or removed an emblem is added or removed from the file icon.
The problem is that the emblem is not immediately visible and a user has to press Ctrl
+ R
to refresh the viewport.
Other native features, such as changing file permissions, add/remove emblems instantly, so it must be something feasible. However I am not sure how to obtain the same result from an extension.
My extension shows the emblems via nautilus_info_provider_update_file_info()
. This function is automatically called by Nautilus for each file every time the viewport is refreshed. However from what I have understood I have no power on forcing a refresh. Have you thought of adding a nautilus_refresh()
public function to the extension API?
--madmurphy
Use cases
An extension can face several situations where a refresh of the viewport is necessary
Desired behavior
Having a nautilus_refresh()
public function for refreshing the viewport
Benefits of the solution
A benefit is not having to use tricks to refresh the viewport, like for example the one used by this python extension, which emulates a fake Ctrl
+ R
key press.
Possible drawbacks
None