diff pidgin/gtkconv.c @ 27793:2f691e22f0d8

propagate from branch 'im.pidgin.pidgin' (head 6d7c3abd2d7bce2089371a61f62aa7b22e59f889) to branch 'im.pidgin.pidgin.yaz' (head 2f9499ffdff7339bb0d5be9c3bdc6137f3f518f9)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 16 Mar 2008 01:05:01 +0000
parents 9f67f9a58564 77b6ff5bdb07
children 92e4a9dce972
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Sat Mar 15 06:52:43 2008 +0000
+++ b/pidgin/gtkconv.c	Sun Mar 16 01:05:01 2008 +0000
@@ -2576,6 +2576,7 @@
 	}
 }
 
+#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
@@ -2588,6 +2589,7 @@
 	gtkconv->auto_resize = FALSE;
 	return FALSE;
 }
+#endif
 
 static gboolean
 redraw_icon(gpointer data)
@@ -4470,23 +4472,19 @@
 	if (wrapped_lines > lines)
 		height += (oneline.height + pad_inside) * (wrapped_lines - lines);
 
-	gtkconv->auto_resize = TRUE;
-	g_idle_add(reset_auto_resize_cb, gtkconv);
-
 	diff = height - gtkconv->entry->allocation.height;
-
-	if (diff > 0) {
-		gtk_widget_size_request(gtkconv->lower_hbox, &sr);
-		gtkconv->entry_growing = TRUE;
-
-		/* uncomment this to auto resize even after the user manually
-		   resizes
-		gtk_paned_set_position(GTK_PANED(gtkconv->lower_hbox->parent->parent),
-			-1);
-		*/
-		gtk_widget_set_size_request(gtkconv->lower_hbox, -1,
-			diff + gtkconv->lower_hbox->allocation.height);
-	}
+	if (diff == 0)
+		return FALSE;
+
+	gtk_widget_size_request(gtkconv->lower_hbox, &sr);
+	gtkconv->entry_growing = TRUE;
+
+	/* uncomment this to auto resize even after the user manually
+	   resizes
+	gtk_paned_set_position(GTK_PANED(gtkconv->lower_hbox->parent->parent), -1);
+	*/
+	gtk_widget_set_size_request(gtkconv->lower_hbox, -1,
+		diff + gtkconv->lower_hbox->allocation.height);
 }
 
 static void
@@ -4834,7 +4832,7 @@
 
 	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_signal_connect_swapped(G_OBJECT(gtkconv->entry), "size-allocate",
 				 G_CALLBACK(resize_imhtml_cb), gtkconv);
 
 	default_formatize(gtkconv);