[Xfce4-commits] r26505 - in xfdesktop/trunk: . modules/menu

Jannis Pohlmann jannis at xfce.org
Thu Dec 27 03:11:14 CET 2007

Am Wed, 26 Dec 2007 16:37:10 -0800
schrieb "Brian J. Tarricone" <bjt23 at cornell.edu>:

> On Thu, 27 Dec 2007 02:15:01 +0100 Jannis Pohlmann wrote:
> > Oops, my bad:
> > 
> >  * libxfce4menu/xfce-menu-monitor.c: Use the KEY, not the VALUE
> >    pointer to remove items from the shared handle hash table. In
> > this case, use the directory string instead of the shared handle.
> > This should fix the issue we've had with monitoring directories
> > only.
> > 
> > Mind to try again? Works fine now over here with both, xfdesktop and
> > menu-test.c.
> Nice, works here too... except...  it's constantly thinking
> something's changed and it needs to be refreshed because
> of /usr/local/share/applications, which doesn't exist on my box.
> Apparently when you try to monitor a nonexistant directory, thunar-vfs
> immediate fires the callback with a DELETED event.  Benny, is this
> expected?
> I guess the workaround here is to check for directory existence in my
> 'add directory' function, and not add a monitor if it doesn't exist.

The problem with this is that the menu won't be updated when a
non-existent directory is created and files are added to it while
xfdesktop is already running. Hmmm, the DELETED event seems kinda odd
to me. I'd be interested in Benny's opinion, too.

> Jannis, also one thing I realised.  It's really wasteful with
> thunar-vfs to specify an 'add file' function since the directory
> monitor will monitor all subfiles.  This you already know.  However,
> without the 'add file' function, the .menu file itself doesn't get
> watched, which is a problem.
> Any ideas about this?  I'm thinking maybe I can specify an 'add file'
> function, but somehow tell XfceMenu (with some kind of flag or extra
> api) not to watch the .desktop files themselves.  But... I dunno.

This is not the worst idea. I might implement some kind of bitmask
stuff for this to make it possible to choose what kind of
files/directories you want to monitor. Expect some news on this at the
beginning of next year, like:

  typdef enum 
  } XfceMenuMonitorFlags;

  void xfce_menu_monitor_set_flags (XfceMenuMonitorFlags flags);
  XfceMenuMonitorFlags flags = xfce_menu_monitor_get_flags (void);

I really think this might be useful due make monitoring possible and
more flexible with regards to the different monitoring systems out

  - Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20071227/753784a5/attachment.pgp>

More information about the Xfce4-dev mailing list