# # old_revision [e4cc3b79eb04e4937c5fa764f6839a8e07397651] # # patch "pidgin/gtkconv.c" # from [c9dd80f7d1cc0314cf6fbcceccb1d4a08f8238af] # to [c4db3fcce8fc7beaf15a0b6bd0f84e07cc228f7f] # ============================================================ --- pidgin/gtkconv.c c9dd80f7d1cc0314cf6fbcceccb1d4a08f8238af +++ pidgin/gtkconv.c c4db3fcce8fc7beaf15a0b6bd0f84e07cc228f7f @@ -2260,8 +2260,7 @@ pidgin_conv_switch_active_conversation(P g_object_set_data(G_OBJECT(entry), "transient_buddy", NULL); regenerate_options_items(gtkconv->win); - gtk_window_set_title(GTK_WINDOW(gtkconv->win->window), - gtk_label_get_text(GTK_LABEL(gtkconv->tab_label))); + pidgin_conv_window_update_title(gtkconv->win); } static void @@ -2520,6 +2519,7 @@ update_tab_icon(PurpleConversation *conv } } +#if 0 /* This gets added as an idle handler when doing something that * redraws the icon. It sets the auto_resize gboolean to TRUE. * This way, when the size_allocate callback gets triggered, it notices @@ -2532,6 +2532,7 @@ static gboolean reset_auto_resize_cb(gpo gtkconv->auto_resize = FALSE; return FALSE; } +#endif static gboolean redraw_icon(gpointer data) @@ -4396,8 +4397,10 @@ static gboolean resize_imhtml_cb(PidginC if (wrapped_lines > lines) height += (oneline.height + pad_inside) * (wrapped_lines - lines); +#if 0 gtkconv->auto_resize = TRUE; g_idle_add(reset_auto_resize_cb, gtkconv); +#endif diff = height - gtkconv->entry->allocation.height; @@ -4738,6 +4741,8 @@ setup_common_pane(PidginConversation *gt g_signal_connect_swapped(G_OBJECT(gtkconv->entry_buffer), "changed", G_CALLBACK(resize_imhtml_cb), gtkconv); + g_signal_connect_swapped(G_OBJECT(gtkconv->entry), "realize", + G_CALLBACK(resize_imhtml_cb), gtkconv); default_formatize(gtkconv); g_signal_connect_after(G_OBJECT(gtkconv->entry), "format_function_clear", @@ -5014,7 +5019,6 @@ private_gtkconv_new(PurpleConversation * gtk_widget_show(gtkconv->toolbar); else gtk_widget_hide(gtkconv->toolbar); - g_idle_add((GSourceFunc)resize_imhtml_cb, gtkconv); if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/im/show_buddy_icons")) gtk_widget_show(gtkconv->infopane_hbox); @@ -6580,7 +6584,7 @@ pidgin_conv_update_fields(PurpleConversa gtk_label_set_text(GTK_LABEL(gtkconv->menu_label), title); if (pidgin_conv_window_is_active_conversation(conv)) - gtk_window_set_title(GTK_WINDOW(win->window), title); + pidgin_conv_window_update_title(win); g_free(title); } @@ -9529,7 +9533,12 @@ static GList *conv_placement_fncs = NULL } ConvPlacementData; static GList *conv_placement_fncs = NULL; -static PidginConvPlacementFunc place_conv = NULL; +typedef struct { + PidginConvPlacementFunc place_conv; + void (*set_title)(PidginWindow *window); + void (*set_icon)(PidginWindow *window); /* Currently unused */ +} PidginConversationWindowManager; +static PidginConversationWindowManager manager; /* This one places conversations in the last made window. */ static void @@ -9885,26 +9894,38 @@ pidgin_conv_placement_set_current_func(P /* If tabs are enabled, set the function, otherwise, NULL it out. */ if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/tabs")) - place_conv = func; + manager.place_conv = func; else - place_conv = NULL; + manager.place_conv = NULL; } PidginConvPlacementFunc pidgin_conv_placement_get_current_func(void) { - return place_conv; + return manager.place_conv; } void pidgin_conv_placement_place(PidginConversation *gtkconv) { - if (place_conv) - place_conv(gtkconv); + if (manager.place_conv) + manager.place_conv(gtkconv); else conv_placement_new_window(gtkconv); } +void +pidgin_conv_window_update_title(PidginWindow *window) +{ + if (manager.set_title) + manager.set_title(window); + else { + PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(window); + gtk_window_set_title(GTK_WINDOW(window->window), + gtk_label_get_text(GTK_LABEL(gtkconv->tab_label))); + } +} + gboolean pidgin_conv_is_hidden(PidginConversation *gtkconv) {