]> spindle.queued.net Git - midori/commitdiff
Prevent a recurive loop when toggling operating controls
authorChristian Dywan <christian@twotoasts.de>
Fri, 8 Jan 2010 00:08:37 +0000 (01:08 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 8 Jan 2010 00:08:37 +0000 (01:08 +0100)
midori/midori-panel.c

index 2bf780eb90b7d410e37ce3d13b6a9ac574640309..4f5c09701d64a633ba397fded377a7ad1d367774 100644 (file)
@@ -522,11 +522,9 @@ midori_panel_set_property (GObject*      object,
         sokoke_widget_set_visible (panel->labelbar, panel->show_controls);
         sokoke_widget_set_visible (panel->toolbar, panel->show_controls);
         if (panel->button_controls)
-        {
             gtk_toggle_tool_button_set_active (
                 GTK_TOGGLE_TOOL_BUTTON (panel->button_controls),
                 !panel->show_controls);
-        }
         break;
     case PROP_RIGHT_ALIGNED:
         midori_panel_set_right_aligned (panel, g_value_get_boolean (value));
@@ -726,7 +724,8 @@ static void
 midori_panel_show_controls_toggled_cb (GtkWidget*   menuitem,
                                        MidoriPanel* panel)
 {
-    g_object_set (panel, "show-controls", !panel->show_controls, NULL);
+    if (panel->show_controls != !gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (menuitem)))
+        g_object_set (panel, "show-controls", !panel->show_controls, NULL);
 }
 #endif