diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:07:42 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-31 01:07:42 +0800 |
commit | 5e818246cfc20394b14756d872145b853a53296c (patch) | |
tree | c9361992b451f4cfee4a2b8f4172a34ee8b7ad6b /src/empathy-chat-window.c | |
parent | f83fcbd246277115aa1e32479fd8a02f4cf73f08 (diff) | |
download | gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar.gz gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar.bz2 gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar.lz gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar.xz gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.tar.zst gsoc2013-empathy-5e818246cfc20394b14756d872145b853a53296c.zip |
Make notifications for unfocused chat windows work properly.
svn path=/trunk/; revision=2287
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r-- | src/empathy-chat-window.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 2f9d59641..1bc9f2056 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -836,37 +836,30 @@ chat_window_set_urgency_hint (EmpathyChatWindow *window, } static gboolean -notification_closed_idle_cb (EmpathyChatWindow *window) +notification_closed_idle_cb (EmpathyChat *chat) { - EmpathyChatWindowPriv *priv = GET_PRIV (window); - - gtk_widget_grab_focus (priv->dialog); + empathy_chat_window_present_chat (chat); return FALSE; } static void chat_window_notification_closed_cb (NotifyNotification *notify, - EmpathyChatWindow *window) + EmpathyChat *chat) { - EmpathyChatWindowPriv *priv = GET_PRIV (window); int reason; reason = notify_notification_get_closed_reason (notify); - if (priv->notification) { - g_object_unref (priv->notification); - priv->notification = NULL; - } - if (reason == 2) { - g_idle_add ((GSourceFunc) notification_closed_idle_cb, window); + empathy_chat_window_present_chat (chat); } } static void -show_or_update_notification (EmpathyMessage *message, - EmpathyChatWindow *window) +chat_window_show_or_update_notification (EmpathyMessage *message, + EmpathyChatWindow *window, + EmpathyChat *chat) { EmpathyContact *sender; char *header; @@ -894,12 +887,12 @@ show_or_update_notification (EmpathyMessage *message, header, body, NULL); notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf); } else { - priv->notification = notify_notification_new (header, body, NULL, priv->dialog); + priv->notification = notify_notification_new (header, body, NULL, NULL); notify_notification_set_timeout (priv->notification, NOTIFY_EXPIRES_DEFAULT); notify_notification_set_icon_from_pixbuf (priv->notification, pixbuf); g_signal_connect (priv->notification, "closed", - G_CALLBACK (chat_window_notification_closed_cb), window); + G_CALLBACK (chat_window_notification_closed_cb), chat); } notify_notification_show (priv->notification, NULL); @@ -942,7 +935,7 @@ chat_window_new_message_cb (EmpathyChat *chat, } if (!has_focus) { - show_or_update_notification (message, window); + chat_window_show_or_update_notification (message, window, chat); } if (has_focus && priv->current_chat == chat) { |