David Reveman wrote:
On Fri, 2007-03-02 at 13:35 +0000, Mike Dransfield wrote:
This seems roughly what I would need. I applied your patches and added
IN_MODIFY since I need that too.
Yes, we need a MODIFY bit.
I am attaching a patch for that
I have also changed the notification functions as you said.
I now create a custom structure to pass through which contains
all the information that I need.
There are 2 major problems though:
1. If I add a delete and a notify function then the closure gets
mixed up. Everything works if I just add 1 but more than 1 and
they seem to interact with each other. I am creating the watches
with different functions, I just pass the same closure (line 1031).
2. The modify notification works, but only the first time. With
the current version I can modify a file once and I get the notification
and the option reloads, but if I modify the file a second time then
I get no notification.
http://www.anykeysoftware.co.uk/compiz/plugins/ini.c
>From a6ef6656910318fe2b1bfa750ac6cb41bf5ed8ef Mon Sep 17 00:00:00 2001
From: [EMAIL PROTECTED] <[EMAIL PROTECTED](none)>
Date: Sat, 3 Mar 2007 20:07:57 +0000
Subject: [PATCH] Added IN_MODIFY bit
---
include/compiz.h | 1 +
plugins/inotify.c | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/compiz.h b/include/compiz.h
index 18c51bc..6542368 100644
--- a/include/compiz.h
+++ b/include/compiz.h
@@ -621,6 +621,7 @@ typedef Bool (*ImageToFileProc) (CompDisplay *display,
#define NOTIFY_CREATE_MASK (1 << 0)
#define NOTIFY_DELETE_MASK (1 << 1)
#define NOTIFY_MOVE_MASK (1 << 2)
+#define NOTIFY_MODIFY_MASK (1 << 3)
typedef void (*FileWatchCallBackProc) (const char *name,
void *closure);
diff --git a/plugins/inotify.c b/plugins/inotify.c
index 9782c61..92a30d7 100644
--- a/plugins/inotify.c
+++ b/plugins/inotify.c
@@ -114,6 +114,9 @@ inotifyMask (CompFileWatch *fileWatch)
if (fileWatch->mask & NOTIFY_MOVE_MASK)
mask |= IN_MOVE;
+ if (fileWatch->mask & NOTIFY_MODIFY_MASK)
+ mask |= IN_MODIFY;
+
return mask;
}
--
1.5.0.1
_______________________________________________
compiz mailing list
compiz@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/compiz