[gtk+] textview: Hide the selection bubble better



commit 52424d86405676bc4d6978e2114ebd0ecf34cfd3
Author: Benjamin Otte <otte redhat com>
Date:   Sat Nov 11 02:47:59 2017 +0100

    textview: Hide the selection bubble better
    
    The selection bubble is not part of the text windows, so hiding it
    during scroll should not be done in the text window code.
    
    Also remove an unused variable that was only set in that code but never
    read.

 gtk/gtktextview.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index bfa4ede..36734e1 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -288,7 +288,6 @@ struct _GtkTextViewPrivate
   guint selection_handle_dragged : 1;
   guint populate_all   : 1;
 
-  guint in_scroll : 1;
   guint handling_key_event : 1;
 };
 
@@ -8697,6 +8696,9 @@ gtk_text_view_value_changed (GtkAdjustment *adjustment,
 
       if (gtk_widget_get_realized (GTK_WIDGET (text_view)))
         {
+          if (priv->selection_bubble)
+            gtk_widget_hide (priv->selection_bubble);
+
           if (dy != 0)
             {
               if (priv->left_window)
@@ -9790,17 +9792,8 @@ text_window_scroll        (GtkTextWindow *win,
                            gint           dx,
                            gint           dy)
 {
-  GtkTextView *view = GTK_TEXT_VIEW (win->widget);
-  GtkTextViewPrivate *priv = view->priv;
-
   if (dx != 0 || dy != 0)
-    {
-      if (priv->selection_bubble)
-        gtk_widget_hide (priv->selection_bubble);
-      view->priv->in_scroll = TRUE;
-      gdk_window_scroll (win->bin_window, dx, dy);
-      view->priv->in_scroll = FALSE;
-    }
+    gdk_window_scroll (win->bin_window, dx, dy);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]