changeset 22153:8f78d223d24e

Fix the bug where removing the typing notification would cause the text to scroll *up* by 2 pixels. I have also added a define 'RESERVE_LINE' which will always reserve a blank line at the end (of the buffer, not of the view) for the typing notification. We can switch to using that if people use it and like it better, (or hate it less ;) )
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 18 Jan 2008 22:40:33 +0000
parents 6e2dc21a33cb
children f577201bf30f
files pidgin/gtkconv.c
diffstat 1 files changed, 11 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Fri Jan 18 15:26:59 2008 +0000
+++ b/pidgin/gtkconv.c	Fri Jan 18 22:40:33 2008 +0000
@@ -3428,9 +3428,14 @@
 		gtk_text_buffer_delete_mark(buffer, stmark);
 		gtk_text_buffer_delete_mark(buffer, enmark);
 		gtk_text_buffer_delete(buffer, &start, &end);
-	} else if (message && *message == '\n' && !*(message + 1))
+	} else if (message && *message == '\n' && message[1] == ' ' && message[2] == '\0')
 		message = NULL;
 
+#ifdef RESERVE_LINE
+	if (!message)
+		message = "\n ";   /* The blank space is required to avoid a GTK+/Pango bug */
+#endif
+
 	if (message) {
 		GtkTextIter iter;
 		gtk_text_buffer_get_end_iter(buffer, &iter);
@@ -3458,7 +3463,11 @@
 		return;
 
 	if (purple_conv_im_get_typing_state(im) == PURPLE_NOT_TYPING) {
-		update_typing_message(gtkconv, "\n");
+#ifdef RESERVE_LINE
+		update_typing_message(gtkconv, NULL);
+#else
+		update_typing_message(gtkconv, "\n ");
+#endif
 		return;
 	}