aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2011-03-17 00:57:25 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-03-17 20:31:53 +0800
commitf918489642f3e0f41f09c774a4e4b80497c9592a (patch)
treed20f7ded567bc2df69f0319492071851ceec2a90 /src
parentb82a98e0508d3a1f7935a13c6aa89acabab3ffe4 (diff)
downloadgsoc2013-empathy-f918489642f3e0f41f09c774a4e4b80497c9592a.tar
gsoc2013-empathy-f918489642f3e0f41f09c774a4e4b80497c9592a.tar.gz
gsoc2013-empathy-f918489642f3e0f41f09c774a4e4b80497c9592a.tar.bz2
gsoc2013-empathy-f918489642f3e0f41f09c774a4e4b80497c9592a.tar.lz
gsoc2013-empathy-f918489642f3e0f41f09c774a4e4b80497c9592a.tar.xz
gsoc2013-empathy-f918489642f3e0f41f09c774a4e4b80497c9592a.tar.zst
gsoc2013-empathy-f918489642f3e0f41f09c774a4e4b80497c9592a.zip
Don't update Contact menu on a focus-in (#644936)
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-window.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 6c6e617eb..bf1ef6b0b 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -150,7 +150,8 @@ static const GtkTargetEntry drag_types_dest_file[] = {
{ "text/uri-list", 0, DND_DRAG_TYPE_URI_LIST },
};
-static void chat_window_update (EmpathyChatWindow *window);
+static void chat_window_update (EmpathyChatWindow *window,
+ gboolean update_contact_menu);
static void empathy_chat_window_add_chat (EmpathyChatWindow *window,
EmpathyChat *chat);
@@ -350,7 +351,7 @@ _submenu_notify_visible_changed_cb (GObject *object,
g_signal_handlers_disconnect_by_func (object,
_submenu_notify_visible_changed_cb,
userdata);
- chat_window_update (EMPATHY_CHAT_WINDOW (userdata));
+ chat_window_update (EMPATHY_CHAT_WINDOW (userdata), TRUE);
}
static void
@@ -581,7 +582,8 @@ chat_window_close_button_update (EmpathyChatWindowPriv *priv,
}
static void
-chat_window_update (EmpathyChatWindow *window)
+chat_window_update (EmpathyChatWindow *window,
+ gboolean update_contact_menu)
{
EmpathyChatWindowPriv *priv = GET_PRIV (window);
gint num_pages;
@@ -594,8 +596,14 @@ chat_window_update (EmpathyChatWindow *window)
chat_window_conversation_menu_update (priv, window);
- chat_window_contact_menu_update (priv,
- window);
+ /* If this update is due to a focus-in event, we know the menu will be
+ the same as when we last left it, so no work to do. Besides, if we
+ swap out the menu on a focus-in, we may confuse any external global
+ menu watching. */
+ if (update_contact_menu) {
+ chat_window_contact_menu_update (priv,
+ window);
+ }
chat_window_title_update (priv);
@@ -623,7 +631,8 @@ append_markup_printf (GString *string,
}
static void
-chat_window_update_chat_tab (EmpathyChat *chat)
+chat_window_update_chat_tab_full (EmpathyChat *chat,
+ gboolean update_contact_menu)
{
EmpathyChatWindow *window;
EmpathyChatWindowPriv *priv;
@@ -727,11 +736,17 @@ chat_window_update_chat_tab (EmpathyChat *chat)
/* Update the window if it's the current chat */
if (priv->current_chat == chat) {
- chat_window_update (window);
+ chat_window_update (window, update_contact_menu);
}
}
static void
+chat_window_update_chat_tab (EmpathyChat *chat)
+{
+ chat_window_update_chat_tab_full (chat, TRUE);
+}
+
+static void
chat_window_chat_notify_cb (EmpathyChat *chat)
{
EmpathyContact *old_remote_contact;
@@ -1619,7 +1634,7 @@ chat_window_page_removed_cb (GtkNotebook *notebook,
if (priv->chats == NULL) {
g_object_unref (window);
} else {
- chat_window_update (window);
+ chat_window_update (window, TRUE);
}
}
@@ -1637,7 +1652,7 @@ chat_window_focus_in_event_cb (GtkWidget *widget,
chat_window_set_urgency_hint (window, FALSE);
/* Update the title, since we now mark all unread messages as read. */
- chat_window_update_chat_tab (priv->current_chat);
+ chat_window_update_chat_tab_full (priv->current_chat, FALSE);
return FALSE;
}