[gtk+/gtk-3-22] ComboBox: Don’t popdown if releasing on scrollbar



commit 99e27ab1455d917840032aa961aac8159a9937c7
Author: Daniel Boles <dboles src gnome org>
Date:   Mon Sep 4 23:41:53 2017 +0100

    ComboBox: Don’t popdown if releasing on scrollbar
    
    On button release, we were popping down if the event widget was anything
    but priv->button. This broke scrolling by clicking a mouse button, i.e.
    when releasing a click in the trough or finishing a drag of either bar.
    That’s unexpected, inconvenient, and pointless. So, let’s stop doing it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=738893

 gtk/gtkcombobox.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 9acb1fb..1755a1e 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -3160,16 +3160,21 @@ gtk_combo_box_list_button_released (GtkWidget      *widget,
 
   if (ewidget != priv->tree_view)
     {
+      GtkScrolledWindow *scrolled_window = GTK_SCROLLED_WINDOW (priv->scrolled_window);
+
       if (ewidget == priv->button &&
           !popup_in_progress &&
           gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->button)))
         {
           gtk_combo_box_popdown (combo_box);
+
           return TRUE;
         }
 
-      /* released outside treeview */
-      if (ewidget != priv->button)
+      /* If released outside treeview, pop down, unless finishing a scroll */
+      if (ewidget != priv->button &&
+          ewidget != gtk_scrolled_window_get_hscrollbar (scrolled_window) &&
+          ewidget != gtk_scrolled_window_get_vscrollbar (scrolled_window))
         {
           gtk_combo_box_popdown (combo_box);
 


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