After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647627 - empathy message notifications persist when chat window is brought into focus
empathy message notifications persist when chat window is brought into focus
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 649325 649911 656501 665145 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-04-13 07:50 UTC by unknown.mosquito
Modified: 2011-11-29 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Delay received message notification and cancel it if msg gets acked in the meantime (1.22 KB, patch)
2011-08-22 14:28 UTC, Xavier Claessens
reviewed Details | Review
Delay received message notification and cancel it if msg gets acked in the meantime (1.59 KB, patch)
2011-08-22 14:53 UTC, Xavier Claessens
none Details | Review
Delay received message notification and cancel it if msg gets acked in the meantime (1.76 KB, patch)
2011-08-22 14:57 UTC, Xavier Claessens
accepted-commit_now Details | Review

Description unknown.mosquito 2011-04-13 07:50:21 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.
Comment 1 Jonny Lamb 2011-05-24 12:36:37 UTC
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).
Comment 2 wrobell 2011-05-25 15:59:39 UTC
*** Bug 649325 has been marked as a duplicate of this bug. ***
Comment 3 Will Thompson 2011-06-13 11:16:59 UTC
*** Bug 649911 has been marked as a duplicate of this bug. ***
Comment 4 Will Thompson 2011-06-13 11:20:49 UTC
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>.
Comment 5 Ross Burton 2011-07-26 18:36:03 UTC
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.
Comment 6 Guillaume Desmottes 2011-08-15 06:29:42 UTC
*** Bug 656501 has been marked as a duplicate of this bug. ***
Comment 7 Guillaume Desmottes 2011-08-16 09:20:55 UTC
(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.
Comment 8 Xavier Claessens 2011-08-22 14:26:10 UTC
Here is the proposed fix:

http://cgit.collabora.com/git/user/xclaesse/gnome-shell.git/log/?h=delay-notification
Comment 9 Xavier Claessens 2011-08-22 14:28:35 UTC
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.
Comment 10 Jasper St. Pierre (not reading bugmail) 2011-08-22 14:36:05 UTC
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);
Comment 11 Xavier Claessens 2011-08-22 14:53:01 UTC
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.
Comment 12 Xavier Claessens 2011-08-22 14:57:26 UTC
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.
Comment 13 Jasper St. Pierre (not reading bugmail) 2011-08-22 15:05:40 UTC
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"
Comment 14 Xavier Claessens 2011-08-22 17:23:17 UTC
thanks, changed that and merged. Cool my first gnome-shell commit \o/
Comment 15 hotani 2011-11-29 18:27:47 UTC
*** Bug 665145 has been marked as a duplicate of this bug. ***