[baobab] Chart: build context menu during construction



commit fca19afe3b210dc528e9bfcb698c16d6f4d1daa0
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Sat Jul 20 14:41:54 2013 +0200

    Chart: build context menu during construction
    
    Fix a critical triggered by the check in leave_notify_event()
    introduced in previous commit, when leaving the chart before opening the
    popup menu.

 src/baobab-chart.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index 682dfc4..ec26102 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -217,6 +217,8 @@ namespace Baobab {
             action_group = new SimpleActionGroup ();
             action_group.add_action_entries (action_entries, this);
             insert_action_group ("chart", action_group);
+
+            build_context_menu ();
         }
 
         public override void realize () {
@@ -593,7 +595,7 @@ namespace Baobab {
             }
         }
 
-        void ensure_context_menu () {
+        void build_context_menu () {
             if (context_menu != null) {
                 return;
             }
@@ -611,8 +613,6 @@ namespace Baobab {
         }
 
         void show_popup_menu (Gdk.EventButton? event) {
-            ensure_context_menu ();
-
             var enable = highlighted_item != null;
             var action = action_group.lookup_action ("open-file") as SimpleAction;
             action.set_enabled (enable);


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