[epiphany] window: Fix criticals when starting in app mode



commit 2c7965560ebcd2e76930087a429be6520b7e4fdd
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Sep 17 15:33:42 2016 -0500

    window: Fix criticals when starting in app mode
    
    Need to be careful to get the actions from the right action group here.
    
    Also, use a typechecking cast to catch errors like this earlier.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761745

 src/ephy-action-helper.c |    2 +-
 src/ephy-window.c        |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/ephy-action-helper.c b/src/ephy-action-helper.c
index 1ecfc24..60750f9 100644
--- a/src/ephy-action-helper.c
+++ b/src/ephy-action-helper.c
@@ -42,7 +42,7 @@ ephy_action_change_sensitivity_flags (GSimpleAction *action,
                                       gboolean       set)
 {
   static GQuark sensitivity_quark = 0;
-  GObject *object = (GObject *)action;
+  GObject *object = G_OBJECT (action);
   guint value;
 
   if (G_UNLIKELY (sensitivity_quark == 0)) {
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 12b1e44..ba508ea 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -3043,12 +3043,14 @@ ephy_window_constructed (GObject *object)
     gtk_widget_set_visible (ephy_header_bar_get_page_menu_button (EPHY_HEADER_BAR (window->header_bar)), 
FALSE);
     gtk_widget_set_visible (ephy_header_bar_get_new_tab_button (EPHY_HEADER_BAR (window->header_bar)), 
FALSE);
 
+    action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "popup");
     new_action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "context-bookmark-page");
     ephy_action_change_sensitivity_flags (G_SIMPLE_ACTION (new_action), SENS_FLAG_CHROME, TRUE);
 
+    action_group = gtk_widget_get_action_group (GTK_WIDGET (window), "win");
     for (i = 0; i < G_N_ELEMENTS (disabled_actions_for_app_mode); i++) {
       new_action = g_action_map_lookup_action (G_ACTION_MAP (action_group),
-                                           disabled_actions_for_app_mode[i]);
+                                               disabled_actions_for_app_mode[i]);
       ephy_action_change_sensitivity_flags (G_SIMPLE_ACTION (new_action),
                                             SENS_FLAG_CHROME, TRUE);
     }


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