[gtk/matthiasc/for-master: 37/38] multiselection: Don't emit nonsensical signals



commit b047b7838d86bc8ba78a13ca9a08211daaed10ef
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jun 5 23:15:20 2020 -0400

    multiselection: Don't emit nonsensical signals
    
    I forgot to add a check here. We only want to emit
    a ::selection-changed if we actually changed it.

 gtk/gtkmultiselection.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkmultiselection.c b/gtk/gtkmultiselection.c
index 31572072a7..9f2daae44a 100644
--- a/gtk/gtkmultiselection.c
+++ b/gtk/gtkmultiselection.c
@@ -212,7 +212,8 @@ gtk_multi_selection_add_or_remove (GtkSelectionModel    *model,
     }
   while (n > 0);
 
-  gtk_selection_model_selection_changed (model, min, max - min + 1);
+  if (min <= max)
+    gtk_selection_model_selection_changed (model, min, max - min + 1);
 
   return TRUE;
 }


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