aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rwxr-xr-xlib/egg/egg-editable-toolbar.c39
2 files changed, 29 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index d123b0f93..68a8c256e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-01-30 Christian Persch <chpe@cvs.gnome.org>
+
+ * lib/egg/egg-editable-toolbar.c: (configure_item_cursor),
+ (egg_editable_toolbar_set_ui_manager):
+
+ Don't double-ref the UI manager.
+ Don't try to set a cursor on windowless widgets.
+
2006-01-30 Jean-François Rameau <jframeau@cvs.gnome.org>
* embed/mozilla/EphyAboutModule.cpp: (GetErrorMessage):
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index c07466380..9fb204968 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -392,25 +392,29 @@ configure_item_sensitivity (GtkToolItem *item, EggEditableToolbar *etoolbar)
}
static void
-configure_item_cursor (GtkToolItem *item, EggEditableToolbar *etoolbar)
+configure_item_cursor (GtkToolItem *item,
+ EggEditableToolbar *etoolbar)
{
- g_return_if_fail (etoolbar != NULL);
- g_return_if_fail (GTK_WIDGET(item)->window != NULL);
-
- if (etoolbar->priv->edit_mode > 0)
+ EggEditableToolbarPrivate *priv = etoolbar->priv;
+ GtkWidget *widget = GTK_WIDGET (item);
+
+ if (widget->window != NULL)
{
- GdkCursor *cursor;
+ if (priv->edit_mode > 0)
+ {
+ GdkCursor *cursor;
- cursor = gdk_cursor_new (GDK_HAND2);
- gdk_window_set_cursor (GTK_WIDGET(item)->window, cursor);
- gdk_cursor_unref (cursor);
+ cursor = gdk_cursor_new (GDK_HAND2);
+ gdk_window_set_cursor (widget->window, cursor);
+ gdk_cursor_unref (cursor);
- gtk_drag_source_set (GTK_WIDGET (item), GDK_BUTTON1_MASK, dest_drag_types,
- G_N_ELEMENTS (dest_drag_types), GDK_ACTION_MOVE);
- }
- else
- {
- gdk_window_set_cursor (GTK_WIDGET(item)->window, NULL);
+ gtk_drag_source_set (widget, GDK_BUTTON1_MASK, dest_drag_types,
+ G_N_ELEMENTS (dest_drag_types), GDK_ACTION_MOVE);
+ }
+ else
+ {
+ gdk_window_set_cursor (GTK_WIDGET(item)->window, NULL);
+ }
}
}
@@ -1241,16 +1245,15 @@ egg_editable_toolbar_set_ui_manager (EggEditableToolbar *etoolbar,
N_("Remove the selected toolbar"), G_CALLBACK (remove_toolbar_cb) },
};
- g_object_ref (manager);
+ etoolbar->priv->manager = g_object_ref (manager);
etoolbar->priv->actions = gtk_action_group_new ("ToolbarActions");
gtk_action_group_set_translation_domain (etoolbar->priv->actions, GETTEXT_PACKAGE);
gtk_action_group_add_actions (etoolbar->priv->actions, actions,
G_N_ELEMENTS (actions), etoolbar);
-
gtk_ui_manager_insert_action_group (manager, etoolbar->priv->actions, -1);
+ g_object_unref (etoolbar->priv->actions);
- etoolbar->priv->manager = g_object_ref (manager);
etoolbar->priv->popup_id = gtk_ui_manager_add_ui_from_string (manager,
"<popup name=\"ToolbarPopup\">"
"<menuitem action=\"MoveToolItem\"/>"