# HG changeset patch # User Elliott Sales de Andrade # Date 1329972089 0 # Node ID e946a9998052c267a789bd8822e788e385c2ee2e # Parent c525ec5015893e1dd2170c4225d996244b452c14 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. diff -r c525ec501589 -r e946a9998052 pidgin/gtkconv.c --- 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), "

"); + gtk_webview_append_html(webview, "

"); + 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), "

"); + gtk_webview_append_html(webview, "

"); + gtk_webview_scroll_to_end(webview, TRUE); g_object_set_data(G_OBJECT(gtkconv->entry), "attach-start-time", NULL); } diff -r c525ec501589 -r e946a9998052 pidgin/gtkdialogs.c --- 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); diff -r c525ec501589 -r e946a9998052 pidgin/gtkwebview.c --- 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); }