cpw.qulogic.gtk3: a158ffaf: don't crash when switching tabs

malu at pidgin.im malu at pidgin.im
Mon Nov 29 03:12:58 EST 2010


----------------------------------------------------------------------
Revision: a158ffafe1542698b7f247410f31b83bcaa89497
Parent:   79dc9708491f3aaddff643ceb1cfdf3d39146e0c
Author:   malu at pidgin.im
Date:     11/29/10 03:05:42
Branch:   im.pidgin.cpw.qulogic.gtk3
URL: http://d.pidgin.im/viewmtn/revision/info/a158ffafe1542698b7f247410f31b83bcaa89497

Changelog: 

don't crash when switching tabs

Changes against parent 79dc9708491f3aaddff643ceb1cfdf3d39146e0c

  patched  pidgin/gtkconv.c

-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	83f8191bce0c169def2be24ccf7b7bd1d4230114
+++ pidgin/gtkconv.c	fc4ee302274eedfd86dae1c1b6eafb858e7244b2
@@ -4675,15 +4675,15 @@ static gboolean resize_imhtml_cb(PidginC
 	int min_height;
 	gboolean interior_focus;
 	int focus_width;
-  GtkAllocation imhtml_allocation;
-  GtkAllocation entry_allocation;
-  GtkAllocation lower_hbox_allocation;
+	GtkAllocation imhtml_allocation;
+	GtkAllocation entry_allocation;
+	GtkAllocation lower_hbox_allocation;
     
-  gtk_widget_get_allocation(gtkconv->imhtml, &imhtml_allocation);
-  gtk_widget_get_allocation(gtkconv->entry, &entry_allocation);
-  gtk_widget_get_allocation(gtkconv->lower_hbox, &lower_hbox_allocation);
-  total_height = imhtml_allocation.height + entry_allocation.height;
-  max_height = total_height / 2;
+	gtk_widget_get_allocation(gtkconv->imhtml, &imhtml_allocation);
+	gtk_widget_get_allocation(gtkconv->entry, &entry_allocation);
+	gtk_widget_get_allocation(gtkconv->lower_hbox, &lower_hbox_allocation);
+	total_height = imhtml_allocation.height + entry_allocation.height;
+	max_height = total_height / 2;
     
 	pad_top = gtk_text_view_get_pixels_above_lines(GTK_TEXT_VIEW(gtkconv->entry));
 	pad_bottom = gtk_text_view_get_pixels_below_lines(GTK_TEXT_VIEW(gtkconv->entry));
@@ -4721,6 +4721,9 @@ static gboolean resize_imhtml_cb(PidginC
 	if (ABS(diff) < oneline.height / 2)
 		return FALSE;
 
+	purple_debug_info("pidgin", "resizing to %d, %d lines\n",
+	                  lower_hbox_allocation.height, min_lines);
+
 	gtk_widget_set_size_request(gtkconv->lower_hbox, -1,
 		diff + lower_hbox_allocation.height);
 
@@ -7309,11 +7312,11 @@ pidgin_conv_get_tab_at_xy(PidginWindow *
 	count = gtk_notebook_get_n_pages(GTK_NOTEBOOK(notebook));
 
 	for (i = 0; i < count; i++) {
-    GtkAllocation allocation;
+    	GtkAllocation allocation;
 
-    gtk_widget_get_allocation(tab, &allocation);
 		page = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), i);
 		tab = gtk_notebook_get_tab_label(GTK_NOTEBOOK(notebook), page);
+		gtk_widget_get_allocation(tab, &allocation);
 
 		/* Make sure the tab is not hidden beyond an arrow */
 		if (!gtk_widget_is_drawable(tab) && gtk_notebook_get_show_tabs(notebook))


More information about the Commits mailing list