Ok, so I start up xfdesktop, and I see printf()s inside the monitor_directory() function I pass in the vtable. Then immediately my 'something changed' callback gets fired, and then I see the printf()s in the remove_monitor() function I passed. And that's it. The monitors don't get re-added, and monitoring doesn't work. Nothing happens if I do 'touch /usr/share/applications/asdf.desktop'. Brian is sad :-(. The *file* monitoring, however, appears to work: if I touch a file that already exists, the 'something changed' callback gets fired. But if I create a new file, nothing happens. This also brings up another point... the 'monitor_file()' vtable entry is useless and wasteful, at least when used with thunar-vfs. thunar-vfs will also monitor all files in the directory passed to it (but it won't monitor the contents of subdirectories). So really, what I'd like to do is set the monitor_file() member of the vtable to NULL, and just provide monitor_directory() and remove_monitor(). As long as you call monitor_directory() for each directory -- and subdirectory -- in the various hierarchies, it'll work rather nicely. (Note that some file monitoring systems, like maybe the old dnotify, require separate monitors on files and directories, so the monitor_file() vtable entry is still useful.)
Hey Brian. I used the time I had on train while traveling back home to work on libxfce4menu a bit. Please check out the latest commit (revision 26500) and test if it works now. Attached is a small sample program which works quite well (and uses thunar-vfs). If you don't want to monitor any files, just set the monitor_file member to NULL. xfce-menu-monitor.c should already support that: if (G_UNLIKELY (xfce_menu_monitor_vtable.monitor_file == NULL)) return; This is a check from xfce_menu_monitor_add_item(). This method is called by XfceMenu's to tell the monitoring system when a file needs to be monitored.
Is this one still valid?
Dunno, will have to look into it again.
I'll close this bug because I really doubt that monitoring is still broken. In the "touch /usr/share/applications/whatever.desktop" situation the appfinder works just fine and so does the desktop menu AFAIK. Feel free to re-open it if it still doesn't work for you.