--- a/src/conversation.c Wed Jun 01 22:34:31 2005 -0400
+++ b/src/conversation.c Fri Jun 03 01:13:52 2005 -0400
@@ -614,8 +614,6 @@
if (ops != NULL && ops->switch_conversation != NULL)
ops->switch_conversation(win, index);
- gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE);
gaim_signal_emit(gaim_conversations_get_handle(),
"conversation-switched", old_conv, conv);
@@ -1514,7 +1512,13 @@
gaim_conv_im_set_typing_state(GAIM_CONV_IM(conv), GAIM_NOT_TYPING);
- if (gaim_conv_window_get_active_conversation(win) != conv) {
+ if (gaim_conv_window_has_focus(win) && + gaim_conv_window_get_active_conversation(win) == conv) + unseen = GAIM_UNSEEN_NONE; if ((flags & GAIM_MESSAGE_NICK) == GAIM_MESSAGE_NICK ||
gaim_conversation_get_unseen(conv) == GAIM_UNSEEN_NICK)
unseen = GAIM_UNSEEN_NICK;
@@ -1525,10 +1529,24 @@
unseen = GAIM_UNSEEN_TEXT;
- unseen = GAIM_UNSEEN_NONE;
gaim_conversation_set_unseen(conv, unseen);
+ * If we received an IM, and the GaimConvWindow is not active, + * then make this conversation the active tab in this GaimConvWindow. + * We do this so that, when the user comes back to the conversation + * window, the first thing they'll see is the new message. This is + * especially important when the IM window is flashing in their + * taskbar--we want the title of the window to be set to the name + * of the person that IMed them most recently. + if ((gaim_conversation_get_type(conv) == GAIM_CONV_IM) && + (!gaim_conv_window_has_focus(win))) + gaim_conv_window_switch_conversation(win, gaim_conversation_get_index(conv)); @@ -1768,6 +1786,8 @@
window = gaim_conversation_get_window(conv);
+ /* TODO: There's a good chance this is no longer necessary */ if (!gaim_conv_window_has_focus(window)) /* don't change the active conversation if the user is using this window */
gaim_conv_window_switch_conversation(window, gaim_conversation_get_index(conv));
--- a/src/gtkconv.c Wed Jun 01 22:34:31 2005 -0400
+++ b/src/gtkconv.c Fri Jun 03 01:13:52 2005 -0400
@@ -146,6 +146,22 @@
+ * When a conversation window is focused, we know the user + * has looked at it so we know there are no longer unseen +focus_win_cb(GtkWidget *w, GdkEventFocus *e, gpointer d) + GaimConvWindow *win = (GaimConvWindow *)d; + GaimConversation *conv = gaim_conv_window_get_active_conversation(win); + gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE); close_conv_cb(GtkWidget *w, gpointer d)
@@ -2979,7 +2995,11 @@
gtkwin = GAIM_GTK_WINDOW(win);
gtkconv = GAIM_GTK_CONVERSATION(conv);
- gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE);
+ * Only set "unseen" to "none" if the window has focus + if (gaim_conv_window_has_focus(win)) + gaim_conversation_set_unseen(conv, GAIM_UNSEEN_NONE); @@ -4578,6 +4598,9 @@
g_signal_connect(G_OBJECT(gtkwin->window), "delete_event",
G_CALLBACK(close_win_cb), win);
+ g_signal_connect(G_OBJECT(gtkwin->window), "focus_in_event", + G_CALLBACK(focus_win_cb), win); /* Create the notebook. */
gtkwin->notebook = gtk_notebook_new();