[libdazzle] suggestion-popover: Fix popover open on items_changed()



commit ca61ce61fda90552182d1b5a50f77476c2d36ff7
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Tue Oct 23 19:24:22 2018 +0200

    suggestion-popover: Fix popover open on items_changed()

 src/suggestions/dzl-suggestion-popover.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/suggestions/dzl-suggestion-popover.c b/src/suggestions/dzl-suggestion-popover.c
index f300c65..06f259e 100644
--- a/src/suggestions/dzl-suggestion-popover.c
+++ b/src/suggestions/dzl-suggestion-popover.c
@@ -22,6 +22,8 @@
 
 #include <glib/gi18n.h>
 
+#include "dzl-debug.h"
+
 #include "animation/dzl-animation.h"
 #include "suggestions/dzl-suggestion.h"
 #include "suggestions/dzl-suggestion-entry.h"
@@ -772,20 +774,25 @@ dzl_suggestion_popover_items_changed (DzlSuggestionPopover *self,
                                       guint                 added,
                                       GListModel           *model)
 {
+  DZL_ENTRY;
+
   g_assert (DZL_IS_SUGGESTION_POPOVER (self));
   g_assert (G_IS_LIST_MODEL (model));
 
+  DZL_TRACE_MSG ("removed=%d, added=%d, requested=%d",
+                 removed, added, self->popup_requested);
+
   if (g_list_model_get_n_items (model) == 0)
     {
       dzl_suggestion_popover_popdown (self);
-      return;
+      DZL_EXIT;
     }
 
   if (self->popup_requested)
     {
       dzl_suggestion_popover_popup (self);
       self->popup_requested = FALSE;
-      return;
+      DZL_EXIT;
     }
 
   /*
@@ -807,6 +814,13 @@ dzl_suggestion_popover_items_changed (DzlSuggestionPopover *self,
                                          G_CALLBACK (dzl_suggestion_popover_notify_child_revealed),
                                          self);
     }
+  else
+    {
+      dzl_suggestion_popover_popup (self);
+      self->popup_requested = FALSE;
+    }
+
+  DZL_EXIT;
 }
 
 static void


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