aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/empathy-chat-window.c9
-rw-r--r--src/empathy-chat-window.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index ea63f29aa..6db60b9e1 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1848,7 +1848,7 @@ empathy_chat_window_new (void)
* be added.
*/
EmpathyChatWindow *
-empathy_chat_window_get_default (void)
+empathy_chat_window_get_default (gboolean room_filter)
{
GList *l;
gboolean separate_windows = TRUE;
@@ -1863,13 +1863,16 @@ empathy_chat_window_get_default (void)
}
for (l = chat_windows; l; l = l->next) {
+ EmpathyChatWindowPriv *priv;
EmpathyChatWindow *chat_window;
GtkWidget *dialog;
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))) {
+ if (empathy_window_get_is_visible (GTK_WINDOW (dialog)) &&
+ empathy_chat_is_room (priv->current_chat) == room_filter) {
/* Found a visible window on this desktop */
return chat_window;
}
@@ -2086,7 +2089,7 @@ empathy_chat_window_present_chat (EmpathyChat *chat)
/* If the chat has no window, create one */
if (window == NULL) {
- window = empathy_chat_window_get_default ();
+ window = empathy_chat_window_get_default (empathy_chat_is_room (chat));
if (!window) {
window = empathy_chat_window_new ();
}
diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h
index 1e4a001e5..4f1920a9c 100644
--- a/src/empathy-chat-window.h
+++ b/src/empathy-chat-window.h
@@ -57,7 +57,7 @@ struct _EmpathyChatWindowClass {
};
GType empathy_chat_window_get_type (void);
-EmpathyChatWindow *empathy_chat_window_get_default (void);
+EmpathyChatWindow *empathy_chat_window_get_default (gboolean room_filter);
EmpathyChatWindow *empathy_chat_window_new (void);
GtkWidget * empathy_chat_window_get_dialog (EmpathyChatWindow *window);
void empathy_chat_window_add_chat (EmpathyChatWindow *window,