After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 324999 - Gnome-panel's places menu is not updated after adding a bookmark
Gnome-panel's places menu is not updated after adding a bookmark
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Monitoring (inotify)
2.13.x
Other Linux
: Normal normal
: ---
Assigned To: John McCutchan
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2005-12-26 11:06 UTC by Sebastien Bacher
Modified: 2006-01-06 02:05 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14



Description Sebastien Bacher 2005-12-26 11:06:52 UTC
This bug has been opened here: http://bugzilla.ubuntu.com/show_bug.cgi?id=21372

"If you open Nautilus, browse to a folder and choose "add a bookmark", it appears
in Nautilus' places sidepar pane but not in gnome-panel's places menu. If, then,
you run killall gnome-panel, the bookmark appears in gnome-panel's places menu."
Comment 1 Christian Kirbach 2005-12-26 20:18:16 UTC
confirming.
Comment 2 Vincent Untz 2005-12-27 15:17:10 UTC
It's not a panel issue: I can reproduce the issue, but when I do "touch ~/.gtk-bookmarks", it works. So, it's either a gnome-vfs or an inotify issue. Moving to gnome-vfs for now.
Comment 3 Christian Kellner 2005-12-28 10:28:32 UTC
Assigning to John (hopefully)
Comment 4 John McCutchan 2006-01-04 01:53:55 UTC
If touch .gtk-bookmarks works, then it isn't an inotify issue. There was a similar bug in egg-recent. Egg-recent was only handling CHANGED events, but it also should have been handling DELETE/CREATE events as well. Could this be the problem here?
Comment 5 Vincent Untz 2006-01-04 07:18:41 UTC
Current code is:

  result = gnome_vfs_monitor_add (&menuitem->priv->bookmarks_monitor,
                                  bookmarks_uri,
                                  GNOME_VFS_MONITOR_FILE,
                                  panel_place_menu_item_gtk_bookmarks_changed,
                                  menuitem);

...

panel_place_menu_item_gtk_bookmarks_changed (GnomeVFSMonitorHandle *handle,
                                             const gchar *monitor_uri,
                                             const gchar *info_uri,
                                             GnomeVFSMonitorEventType event_type,
                                             gpointer user_data)
{
        panel_place_menu_item_recreate_menu (GTK_WIDGET (user_data));
}


So, we're not even checking the type of event (which might be a bug, btw ;-))
Comment 6 John McCutchan 2006-01-05 00:35:23 UTC
Vincent, could you add a printf to the callback and find out what the different event streams look like?
Comment 7 Vincent Untz 2006-01-05 07:20:39 UTC
So, here's the callback code:

static void
panel_place_menu_item_gtk_bookmarks_changed (GnomeVFSMonitorHandle *handle,
					     const gchar *monitor_uri,
					     const gchar *info_uri,
					     GnomeVFSMonitorEventType event_type,
					     gpointer user_data)
{
	if (event_type == GNOME_VFS_MONITOR_EVENT_CHANGED) {
		g_print ("monitor event == GNOME_VFS_MONITOR_EVENT_CHANGED\n");
	} else if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED) {
		g_print ("monitor event == GNOME_VFS_MONITOR_EVENT_DELETED\n");
	} else if (event_type == GNOME_VFS_MONITOR_EVENT_STARTEXECUTING) {
		g_print ("monitor event == GNOME_VFS_MONITOR_EVENT_STARTEXECUTING\n");
	} else if (event_type == GNOME_VFS_MONITOR_EVENT_STOPEXECUTING) {
		g_print ("monitor event == GNOME_VFS_MONITOR_EVENT_STOPEXECUTING\n");
	} else if (event_type == GNOME_VFS_MONITOR_EVENT_CREATED) {
		g_print ("monitor event == GNOME_VFS_MONITOR_EVENT_CREATED\n");
	} else if (event_type == GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED) {
		g_print ("monitor event == GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED\n");
	} else {
		g_print ("monitor event == unknown\n");
	}

	panel_place_menu_item_recreate_menu (GTK_WIDGET (user_data));
}

When I manage (ie, add and/or remove) bookmarks in nautilus, I don't see anything printed. Then, when I do "touch ~/.gtk-bookmarks", I see

monitor event == GNOME_VFS_MONITOR_EVENT_METADATA_CHANGED

Maybe the Ubuntu dapper kernel is broken?
Comment 8 John McCutchan 2006-01-06 02:05:49 UTC
Nope, it was a bug in the inotify backend.

Fixed in CVS:
2006-01-05  John McCutchan  <ttb@tentacle.dhs.org>

    * modules/inotify-path.c: (ip_event_dispatch):
    When delivering a paired MOVED_TO event do the right thing and check the
    MOVED_TO filename instead of the MOVED_FROM. (#324999)