Le Boulanger Yann wrote:
Frederic Peters wrote:

Le Boulanger Yann wrote:


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 ?



Notification window should appear just below systray icon, http://www.0d.be/files/gajim-new-message-notification.png



Arg what a silly man I am. Indentation error. Shame on me. Now it works, but there is a pb:

when a second popup has to be displayed, it's over the first one. So i'm not sure it's good to apply that.

What do other think ?


If some ppl want to test, here is the patch to apply.
Index: src/notify.py
===================================================================
--- src/notify.py	(revision 5505)
+++ src/notify.py	(working copy)
@@ -146,6 +146,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')),
@@ -160,12 +175,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
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel

Reply via email to