aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-22 20:18:34 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-22 20:18:34 +0800
commita0570eb786037e9855a0a8a51aabc5c6130ad342 (patch)
tree706050a70c366feb58f1150f7e75b81a1713adc2
parent45e2e349b685c33338ab3e60a64b038d0b22385a (diff)
parent2324b39d322867c4ef583265cf7c5d840a72cb02 (diff)
downloadgsoc2013-empathy-a0570eb786037e9855a0a8a51aabc5c6130ad342.tar
gsoc2013-empathy-a0570eb786037e9855a0a8a51aabc5c6130ad342.tar.gz
gsoc2013-empathy-a0570eb786037e9855a0a8a51aabc5c6130ad342.tar.bz2
gsoc2013-empathy-a0570eb786037e9855a0a8a51aabc5c6130ad342.tar.lz
gsoc2013-empathy-a0570eb786037e9855a0a8a51aabc5c6130ad342.tar.xz
gsoc2013-empathy-a0570eb786037e9855a0a8a51aabc5c6130ad342.tar.zst
gsoc2013-empathy-a0570eb786037e9855a0a8a51aabc5c6130ad342.zip
Merge remote branch 'vminko/fix-625780'
-rw-r--r--src/empathy-chat-window.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index a92e28b2a..f8cc8ff82 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -2112,9 +2112,8 @@ empathy_chat_window_get_dialog (EmpathyChatWindow *window)
return priv->dialog;
}
-/* Returns the window to open a new tab in if there is only one window
- * visble, otherwise, returns NULL indicating that a new window should
- * be added.
+/* Returns the window to open a new tab in if there is a suitable window,
+ * otherwise, returns NULL indicating that a new window should be added.
*/
static EmpathyChatWindow *
empathy_chat_window_get_default (gboolean room)
@@ -2137,26 +2136,27 @@ empathy_chat_window_get_default (gboolean room)
EmpathyChatWindowPriv *priv;
EmpathyChatWindow *chat_window;
GtkWidget *dialog;
+ guint nb_rooms, nb_private;
chat_window = l->data;
priv = GET_PRIV (chat_window);
dialog = empathy_chat_window_get_dialog (chat_window);
- if (empathy_window_get_is_visible (GTK_WINDOW (dialog))) {
- guint nb_rooms, nb_private;
- empathy_chat_window_get_nb_chats (chat_window, &nb_rooms, &nb_private);
- /* Skip the window if there aren't any rooms in it */
- if (room && nb_rooms == 0)
- continue;
+ empathy_chat_window_get_nb_chats (chat_window, &nb_rooms, &nb_private);
- /* Skip the window if there aren't any 1-1 chats in it */
- if (!room && nb_private == 0)
- continue;
+ /* Skip the window if there aren't any rooms in it */
+ if (room && nb_rooms == 0)
+ continue;
- /* Found a visible window on this desktop */
- return chat_window;
- }
+ /* Skip the window if there aren't any 1-1 chats in it */
+ if (!room && nb_private == 0)
+ continue;
+
+ /* Found a window on this desktop, make it visible if necessary */
+ if (!empathy_window_get_is_visible (GTK_WINDOW (dialog)))
+ empathy_window_present (GTK_WINDOW (dialog));
+ return chat_window;
}
return NULL;