summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Bosveld <Joel.Bosveld@gmail.com>2009-02-25 12:14:03 +0900
committerErkin Bahceci <erkinbah@gmail.com>2009-08-15 22:05:02 -0500
commit911dd279e05ef0da0d7825e3a4031236be0c06d0 (patch)
treeccf415eaa3e5349c887c4a807285361bac4a932e
parent46485724a0cc8c27b9c79fbf2320a78611438d3b (diff)
downloadwinrules-911dd279e05ef0da0d7825e3a4031236be0c06d0.tar.gz
winrules-911dd279e05ef0da0d7825e3a4031236be0c06d0.tar.bz2
Remove compTimeout on window destroy.
-rw-r--r--winrules.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/winrules.c b/winrules.c
index 65ef417..21ce98a 100644
--- a/winrules.c
+++ b/winrules.c
@@ -53,6 +53,8 @@ typedef struct _WinrulesWindow {
Bool oldInputHint;
Bool hasAlpha;
+
+ CompTimeoutHandle handle;
} WinrulesWindow;
typedef struct _WinrulesDisplay {
@@ -464,9 +466,8 @@ winrulesSetScreenOption (CompPlugin *plugin,
}
static Bool
-winrulesApplyRules (void *closure)
+winrulesApplyRules (CompWindow *w)
{
- CompWindow *w = (CompWindow *) closure;
int width, height;
winrulesUpdateState (w,
@@ -527,6 +528,17 @@ winrulesApplyRules (void *closure)
return FALSE;
}
+static Bool
+winrulesApplyRulesTimeout (void *closure)
+{
+ CompWindow *w = (CompWindow *) closure;
+
+ WINRULES_WINDOW (w);
+ ww->handle = 0;
+
+ return winrulesApplyRules (w);
+}
+
static void
winrulesHandleEvent (CompDisplay *d,
XEvent *event)
@@ -736,7 +748,7 @@ winrulesInitWindow (CompPlugin *p,
w->base.privates[ws->windowPrivateIndex].ptr = ww;
- compAddTimeout (0, 0, winrulesApplyRules, w);
+ ww->handle = compAddTimeout (0, 0, winrulesApplyRulesTimeout, w);
return TRUE;
}
@@ -747,6 +759,9 @@ winrulesFiniWindow (CompPlugin *p,
{
WINRULES_WINDOW (w);
+ if (ww->handle)
+ compRemoveTimeout (ww->handle);
+
free (ww);
}