PDA

View Full Version : Notification plugin


mikedee
June 1st, 2007, 10:57 AM
This is a small plugin which uses the new loging framework (You need git > 20070527), it shows compiz errors as a nice libnotify popup on your desktop rather than being lost in stderr. This is useful for plugin loading errors.

There are 5 log levels Fatal, Error, Warn, Info and Debug. The max log level is set to Error by default, you can change it to an int from 0-4 to represent the log levels. I would not recommend setting it above Warn. Fatal errors are not going to be reported through this because they relate to errors where compiz cannot start or has to shut down, in which case this plugin would not be loaded.

It includes a compiz icon which I ripped from here, if anyone wants to submit a better one, please do :)

It is hosted in git, you can get a copy like this

git clone git://people.freedesktop.org/~mike/notification

Update with

git pull

EDIT: According to the libnotify home page version 0.4.4 supports alpha and the popups should be slightly transparent, you will also need notification-daemon >0.3.7

maniac
July 31st, 2007, 03:08 PM
There is a crash problem in notification. The return value of logLevelFromString is free'd, although it was never allocated (this function returns a static string).

Mike, please apply this patch to fix it:


From fbafd6d889b6229af9b8b3adc9449f2ac1429ce6 Mon Sep 17 00:00:00 2001
From: Danny Baumann <dannybaumann@web.de>
Date: Tue, 31 Jul 2007 16:07:57 +0200
Subject: [PATCH] Do not free values that were never allocated.

---
notification.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/notification.c b/notification.c
index 93e2987..359e6f2 100644
--- a/notification.c
+++ b/notification.c
@@ -114,7 +114,6 @@ notifyLogMessage (CompDisplay *d,
fprintf (stderr, "failed to send notification\n");

g_object_unref (G_OBJECT (n));
- free (logLevel);
free (iconUri);

UNWRAP (nd, d, logMessage);
--
1.5.2.2

mikedee
July 31st, 2007, 04:23 PM
Applied - thanks :)