[geany/geany-plugins] d1a4dd: Markdown: Another try at fixing the scroll jumping

Matthew Brush git-noreply at xxxxx
Sat Aug 3 22:44:44 UTC 2013


Branch:      refs/heads/master
Author:      Matthew Brush <matt at geany.org>
Committer:   Matthew Brush <matt at geany.org>
Date:        Sat, 03 Aug 2013 22:44:44 UTC
Commit:      d1a4dd15089551cd2eddcf9beb77ee9256f2d26f
             https://github.com/geany/geany-plugins/commit/d1a4dd15089551cd2eddcf9beb77ee9256f2d26f

Log Message:
-----------
Markdown: Another try at fixing the scroll jumping

When typing fast the webview would jump to the top, which was super
annoying. This is an attempt to fix the symptom but it doesn't really
address the real cause. Thanks to "moebiuseye" for the patch.


Modified Paths:
--------------
    markdown/src/viewer.c

Modified: markdown/src/viewer.c
9 files changed, 7 insertions(+), 2 deletions(-)
===================================================================
@@ -249,9 +249,14 @@ struct _MarkdownViewerPrivate
   if (GTK_IS_SCROLLED_WINDOW(parent)) {
     GtkAdjustment *adj;
     adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(parent));
-    self->priv->vscroll_pos = gtk_adjustment_get_value(adj);
+    /* Another hack to try and keep scroll position from
+     * resetting to top while typing, just don't store the new
+     * scroll positions if they're 0. */
+    if (gtk_adjustment_get_value(adj) != 0)
+        self->priv->vscroll_pos = gtk_adjustment_get_value(adj);
     adj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(parent));
-    self->priv->hscroll_pos = gtk_adjustment_get_value(adj);
+    if (gtk_adjustment_get_value(adj) != 0)
+        self->priv->hscroll_pos = gtk_adjustment_get_value(adj);
     pushed = TRUE;
   }
 



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list