libxfce4menu filesystem monitoring

Jannis Pohlmann jannis at
Mon Oct 1 13:20:04 CEST 2007

Am Mon, 1 Oct 2007 00:08:03 -0700
schrieb "Brian J. Tarricone" <bjt23 at>:

> Hey Jannis,
> On Thu, 20 Sep 2007 21:59:37 +0200 Jannis Pohlmann wrote:
> > Brian, this is all you need to do to use the new feature in
> > xfdesktop:
> [snip]
> Ok, I set this up as discussed, and it's not really working properly.

First of all thanks for that. This makes it easier to test the whole

> For starters, it doesn't look like it's watching directories -- if I
> create a new .desktop file in ~/.local/share/applications/, nothing
> happens.
> If I edit an existing file there, my printf()s indicate that the
> monitors get fired off, but the menu doesn't reflect the change (are
> you still doing that evil caching of the file contents?).

Yeah, I still do. I am going to disable it for now though. Thunar will
need some sort of caching for performance reasons but for the menu
widget it doesn't really matter I guess.

The current monitor system state is just another step to really useful
monitoring. Remember we talked about telling a menu which file has
changed rather than just regenerating the whole menu? That will also
fix caching. It will work like this:

 1. libxfce4menu asks xfdesktop/thunar to monitor a file/directory
 2. a changed event occurs => xfdesktop/thunar tell libxfce4menu that a
    certain monitor handle has changed
 3. libxfce4menu looks up the XfceMenu and filename for this handle and
    asks the XfceMenu to update that filename
 4. the XfceMenu asks the cache to invalidate and reload the
    XfceMenuItem for this filename

In case of .directory dirs the XfceMenu can handle the update itself.
This will make things a lot more comfortable. But it will also take
some time for me to implement, that's why I'm doing this incrementally.

> Also, I get a bunch of these messages every time the menu changes
> (might be happening when I unref the XfceMenu too):
> (xfdesktop:14288): thunar-vfs-CRITICAL **: thunar_vfs_monitor_remove:
> assertion `g_list_find (monitor->handles, handle) != NULL' failed
> It doesn't happen for every call to _remove_monitor(), though, just
> some of them.
> I've committed the code to xfdesktop trunk (with some
> potentially-useful debug output with --enabke-debug); maybe you could
> take a look?

Yeah, I'll debug everything and hopefully find out what's wrong. 

> 	-brian
> P.S. Can you bump libxfce4menu's package version so xfdesktop can
> depend on the new version?

Do you mean libxfce4menu_verinfo? The pkg-config module version is
updated with every commit.

  - Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the Xfce4-dev mailing list