GNOME Bugzilla – Bug 647627
empathy message notifications persist when chat window is brought into focus
Last modified: 2011-11-29 18:27:47 UTC
I'm experiencing an issue where the Shell notifications continue to pop up even while the actual IM window is focused, and even when I'm actively typing in it. It always pops up when I receive a reply and sometimes it even pops up with the message I've just sent from the IM window.
I fixed the problem of notifications of your own messages popping up in master. Stopping the message tray from notifying when the Empathy chat window is in focus is pretty difficult though and would mean Empathy would mean to send out the messages instead. Another crazy idea is that the shell could not notify straight away when it sees a new message and instead waits a tiny bit and then cancels the notification if the message is acked (by the Empathy chat window).
*** Bug 649325 has been marked as a duplicate of this bug. ***
*** Bug 649911 has been marked as a duplicate of this bug. ***
We discussed this a little at <https://live.gnome.org/Hackfests/IMContacts%20Social2011>, and came up with these possible fixes, in no particular order: • delay the notification for a few ms in case it's acked immediately; • put a x property on the window to tell the shell that that conversation is in the foreground; • put a boolean “Foreground” property on the Channel object; • handler d-bus property? avoids bouncing off the CM and back. danni doesn't like it and nor does guillaume; • move showing notifications into Empathy. More context at <https://live.gnome.org/Hackfests/IMContacts%20Social2011/Tasks/ShellDesignChat#Notes_from_the_discussion>.
This is driving me crazy, doubly so because for years I've been lining my chat windows at the bottom of the screen so the notifications sit on top of the empathy chat. The delayed notification sounds like the most pragmatic and less complex solution.
*** Bug 656501 has been marked as a duplicate of this bug. ***
(In reply to comment #4) > • delay the notification for a few ms in case it's acked immediately; We agreed during our BoF that was the best way to solve this.
Here is the proposed fix: http://cgit.collabora.com/git/user/xclaesse/gnome-shell.git/log/?h=delay-notification
Created attachment 194369 [details] [review] Delay received message notification and cancel it if msg gets acked in the meantime If empathy's chat window has the focus when the message arrive, it will ack the message and gnome-shell should not show a notification for it.
Review of attachment 194369 [details] [review]: ::: js/ui/telepathyClient.js @@ +382,3 @@ + // Wait a bit before notifying for the received message, an handler + // could ack it in the meantime. + Mainloop.timeout_add(500, Lang.bind(this, this._notifyTimeout)); What happens when two messages come in with less than 500ms between them? I assume we want to re-set the handler, so you need to save the timeout ID and remove it. Additionally, use a constant: if (this._notifyTimeoutId != 0) { Mainloop.source_remove(this._notifyTimeoutId); this._notifyTimeoutId = 0; } this._notifyTimeoutId = Mainloop.timeout_add(NOTIFY_TIME, Lang.bind(this, this._notifyTimeout);
Created attachment 194371 [details] [review] Delay received message notification and cancel it if msg gets acked in the meantime If empathy's chat window has the focus when the message arrive, it will ack the message and gnome-shell should not show a notification for it.
Created attachment 194373 [details] [review] Delay received message notification and cancel it if msg gets acked in the meantime If empathy's chat window has the focus when the message arrive, it will ack the message and gnome-shell should not show a notification for it.
Review of attachment 194373 [details] [review]: Keep your commit message under 80 chars. Something like: telepathyClient: Delay notification in case it gets acked The shell should only notify in case no other client handles the message. Empathy will ack the message if focused, so we don't want to step on its toes. Code looks good. ::: js/ui/telepathyClient.js @@ +381,3 @@ this._notification.appendMessage(message); + + // Wait a bit before notifying for the received message, an handler "a handler"
thanks, changed that and merged. Cool my first gnome-shell commit \o/
*** Bug 665145 has been marked as a duplicate of this bug. ***