! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
icons of .desktop files get duplicated when edited
Status:
CLOSED: FIXED
Product:
Thunar-vfs
Component:
General

Comments

Description Vincent Paeder 2006-04-21 13:37:39 CEST
.desktop files placed on the desktop appear twice after having been edited. This happens either by editing them manually or through the properties dialog.

Steps to reproduce:
1. place a .desktop file on the desktop
2. open it with a text editor or open the properties dialog
3. save your changes

Result
the icon is displayed twice (1x old version + 1x new version)
Comment 1 Vincent Paeder 2006-04-21 13:42:24 CEST
it also happens with the rename command in context menu
Comment 2 Brian J. Tarricone (not reading bugmail) 2006-04-21 16:35:15 CEST
Unable to reproduce.  gtk version?
Comment 3 Jari Rahkonen 2006-04-29 08:41:31 CEST
(In reply to comment #2)
> Unable to reproduce.  gtk version?

I can reproduce this using gtk 2.8.17. The icon is duplicated when I switch to the Laucher tab of the properties dialog and when I click any of the two check boxes in it. I also get a new icon when I close the dialog. It seems that only the icon that last appeared on the desktop can be selected. Xfdesktop segfaults If I try to drag this icon around, and there seem to be other related ways of making it crash. 

If I hover my mouse over any of the non-working icons, I get a lot of output in the terminal. Here are some distinct rows of output:

(xfdesktop:31356): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `XfdesktopIcon'

** (xfdesktop:31356): CRITICAL **: xfdesktop_icon_get_extents: assertion `XFDESKTOP_IS_ICON(icon)' failed

** (xfdesktop:31356): CRITICAL **: xfdesktop_check_icon_needs_repaint: assertion `icon_view' failed

** (xfdesktop:31356): CRITICAL **: xfdesktop_icon_get_position: assertion `XFDESKTOP_IS_ICON(icon)' failed

** (xfdesktop:31356): CRITICAL **: xfdesktop_icon_view_paint_icon: assertion `xfdesktop_icon_get_position(icon, &row, &col)' failed

(xfdesktop:31356): GLib-GObject-CRITICAL **: g_object_get_data: assertion `G_IS_OBJECT (object)' failed

I can provide a gdb backtrace of the crash if needed.
Comment 4 Benedikt Meurer editbugs 2006-05-01 15:33:25 CEST
The problem is a race condition between g_file_set_content(), which uses atomic saving (writing to tmp file and rename), and so inotify sends a deleted event for the file and a created once the rename is done. Kinda weird, but that's inotify. I'll fix thunar-vfs/thunar-apr to not use g_file_set_content() any more.
Comment 5 Benedikt Meurer editbugs 2006-05-01 15:33:43 CEST
Fixed with revision 21426.

2006-05-01	Benedikt Meurer <benny@xfce.org>

	* plugins/thunar-apr/thunar-apr-desktop-page.c
	  (thunar_apr_desktop_page_save),
	  thunar-vfs/thunar-vfs-info.c(thunar_vfs_info_rename): Avoid race
	  condition between g_file_set_content() and inotify. Bug #1701.

Comment 6 Vincent Paeder 2006-05-01 18:53:26 CEST
*** Bug 1702 has been marked as a duplicate of this bug. ***
Comment 7 Brian J. Tarricone (not reading bugmail) 2006-05-01 19:10:56 CEST
*** Bug 1741 has been marked as a duplicate of this bug. ***

Bug #1701

Reported by:
Vincent Paeder
Reported on: 2006-04-21
Last modified on: 2010-11-07
Duplicates (2):
  • 1702 renaming a .desktop file sitting on the desktop from a terminal makes xfdesktop crash
  • 1741 Crash on .desktop launcher rename

People

Assignee:
Jannis Pohlmann
CC List:
3 users

Version

Version:
unspecified

Attachments

Additional information