Frederic Peters wrote:
Hello,

I'll first thanks you for gajim.

I've been musing with GNOME notification daemon recently and patched
gajim so it attachs its notifiations under the systray icon (if
present).

This is done on 0.9.1 since it is what I use here but I ported my
patch to current SVN version (although I didn't test this one).

It is a bit ugly since src/notify.py must then know about current
systray icon (so it can calculate x,y to position the window) but
I couldn't find another way (and probably don't know enough about
gajim internals to it properly).

Anyway here it is attached and keep up the good work.


Regards,

        Frederic


I've modified it a bit, but here it does nothing. my taskbar is on top, systray on the right. I suppose it is supposed to put the notification window on top right ?

Yann
Index: notify.py
===================================================================
--- notify.py   (revision 5496)
+++ notify.py   (working copy)
@@ -148,6 +148,21 @@
                                (name, version, version, spec_version) = 
self.notif.GetServerInformation()
                        except:
                                version = '0.3.1'
+
+               hints = {}
+               if gajim.interface.systray_enabled and 
gajim.interface.systray.t:
+                       x, y = gajim.interface.systray.t.window.get_origin()
+                       w, h = gajim.interface.systray.t.size_request()
+                       x += w/2
+                       if y < 100:
+                               # top-panel
+                               y += h
+                       else:
+                               # bottom-panel
+                               y -= h
+                               hints['x'] = x
+                               hints['y'] = y
+
                if version.startswith('0.2'):
                        try:
                                self.id = 
self.notif.Notify(dbus.String(_('Gajim')),
@@ -162,12 +177,12 @@
                                self.id = 
self.notif.Notify(dbus.String(_('Gajim')),
                                        dbus.UInt32(0), 
dbus.String(path_to_image),
                                        dbus.String(event_type), 
dbus.String(text), (dbus.String(ntype),
-                                       dbus.String(event_type)), {}, 
dbus.UInt32(timeout*1000))
+                                       dbus.String(event_type)), hints, 
dbus.UInt32(timeout*1000))
                        else:
                                self.id = 
self.notif.Notify(dbus.String(_('Gajim')),
                                        dbus.String(path_to_image), 
dbus.UInt32(0),
                                        dbus.String(event_type), 
dbus.String(text), dbus.String(''),
-                                       {}, dbus.UInt32(timeout*1000))
+                                       hints, dbus.UInt32(timeout*1000))
                notification_response_manager.attach_to_interface()
                notification_response_manager.pending[self.id] = self
 
_______________________________________________
Gajim-devel mailing list
[EMAIL PROTECTED]
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel

Reply via email to