changeset 32539:e946a9998052

Remove the automatic scroll-to-end when appending HTML to a webview. Conversations already do this using JS in the theme, and this only messes with the Help dialogs.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 23 Feb 2012 04:41:29 +0000
parents c525ec501589
children b0ebc1938c2d
files pidgin/gtkconv.c pidgin/gtkdialogs.c pidgin/gtkwebview.c
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv.c	Thu Feb 23 04:07:32 2012 +0000
+++ b/pidgin/gtkconv.c	Thu Feb 23 04:41:29 2012 +0000
@@ -8212,6 +8212,7 @@
 add_message_history_to_gtkconv(gpointer data)
 {
 	PidginConversation *gtkconv = data;
+	GtkWebView *webview = GTK_WEBVIEW(gtkconv->webview);
 	int count = 0;
 	int timer = gtkconv->attach.timer;
 	time_t when = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(gtkconv->entry), "attach-start-time"));
@@ -8221,7 +8222,8 @@
 	while (gtkconv->attach.current && count < 100) {  /* XXX: 100 is a random value here */
 		PurpleConvMessage *msg = gtkconv->attach.current->data;
 		if (!im && when && when < purple_conversation_message_get_timestamp(msg)) {
-			gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), "<BR><HR>");
+			gtk_webview_append_html(webview, "<BR><HR>");
+			gtk_webview_scroll_to_end(webview, TRUE);
 			g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
 		}
 		pidgin_conv_write_conv(
@@ -8268,7 +8270,8 @@
 					purple_conversation_message_get_flags(msg),
 					purple_conversation_message_get_timestamp(msg));
 		}
-		gtk_webview_append_html(GTK_WEBVIEW(gtkconv->webview), "<BR><HR>");
+		gtk_webview_append_html(webview, "<BR><HR>");
+		gtk_webview_scroll_to_end(webview, TRUE);
 		g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL);
 	}
 
--- a/pidgin/gtkdialogs.c	Thu Feb 23 04:07:32 2012 +0000
+++ b/pidgin/gtkdialogs.c	Thu Feb 23 04:41:29 2012 +0000
@@ -456,8 +456,6 @@
 	gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
 
 	gtk_webview_append_html(GTK_WEBVIEW(webview), string->str);
-	/* TODO WEBKIT: This doesn't seem to stay at the top. */
-	webkit_web_view_move_cursor(WEBKIT_WEB_VIEW(webview), GTK_MOVEMENT_BUFFER_ENDS, -1);
 
 	button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE,
 	                G_CALLBACK(destroy_win), win);
--- a/pidgin/gtkwebview.c	Thu Feb 23 04:07:32 2012 +0000
+++ b/pidgin/gtkwebview.c	Thu Feb 23 04:41:29 2012 +0000
@@ -579,7 +579,6 @@
 	char *script = g_strdup_printf("document.write(%s)", escaped);
 	webkit_web_view_execute_script(WEBKIT_WEB_VIEW(webview), script);
 	priv->empty = FALSE;
-	gtk_webview_scroll_to_end(webview, TRUE);
 	g_free(script);
 	g_free(escaped);
 }