diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-01-31 06:34:39 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-01-31 06:34:39 +0800 |
commit | 7d08bb7e103b567fd9fc707d4625be9a1335f3fd (patch) | |
tree | c0bc01efbab5781f157cc6cb8cc54b27dfb7988a /lib | |
parent | 40baab8178637f734380ace4cab5c54c0e31cd86 (diff) | |
download | gsoc2013-epiphany-7d08bb7e103b567fd9fc707d4625be9a1335f3fd.tar.gz gsoc2013-epiphany-7d08bb7e103b567fd9fc707d4625be9a1335f3fd.tar.zst gsoc2013-epiphany-7d08bb7e103b567fd9fc707d4625be9a1335f3fd.zip |
Don't double-ref the UI manager. Don't try to set a cursor on windowless
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.
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/egg/egg-editable-toolbar.c | 39 |
1 files changed, 21 insertions, 18 deletions
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\"/>" |