[compiz] Flat file backend (ini)

Gerd Kohlberger lowfi at chello.at
Tue Feb 27 11:58:59 PST 2007


>> It is working fine but there are a couple of problems.
>>
>> 1. It looks like I should use addFileWatch rather than
>> directly accessing FAM, is this correct?  I notice dbus
>> uses addFileWatch rather than (*d->addFileWatch) is
>> this intentional, and does it get wrapped in the same
>> way?
> 
> Yep, you should use the file watch interface instead of FAM. You should
> call addFileWatch to add a watch for a specific file or directory.
> addFileWatch will then call display->fileWatchAdded which is a wrapped
> function that plugins that provide file watch functionality like the
> inotify function will hook into. If you have any problems with using the
> file watch interface please let me know.
> 

Hi,

I modified the inotify plugin to send an event structure instead of just
the file name in the callback. The event contains an event mask to allow to
switch between event types in the callback, and the file name.

Currently the name variable in the callback sends the event->name of the inotify struct,
but that's not very useful. eg. if you watch two files directly, there is no way to distinguish
between them in the callback, because event->name will be empty.

So the new CompNotifyEvent will send the watch path if a file is watched,
or the relative filename if a directory is watched.

I think this can be very useful for the ini plugin and for other plugins as well.

Any thoughts on that?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: inotify.c_notifyevent.diff
Type: text/x-patch
Size: 1508 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20070227/7218683e/inotify.c_notifyevent.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiz.h_notifyevent.diff
Type: text/x-patch
Size: 667 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20070227/7218683e/compiz.h_notifyevent.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus.c_notifyevent.diff
Type: text/x-patch
Size: 470 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/compiz/attachments/20070227/7218683e/dbus.c_notifyevent.bin


More information about the compiz mailing list