From b80a930d392d2719f916f6fcc975b60d1cfb2169 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 19 Sep 2005 14:02:30 +0000 Subject: Make the methods to unset/release the context event semi-public. 2005-09-19 Christian Persch * src/ephy-window.c: (_ephy_window_set_context_event), (_ephy_window_unset_context_event), (embed_popup_deactivate_cb), (show_embed_popup), (ephy_window_dispose): * src/ephy-window.h: Make the methods to unset/release the context event semi-public. --- src/ephy-window.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'src/ephy-window.c') diff --git a/src/ephy-window.c b/src/ephy-window.c index 0a1581aae..5283818fa 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1583,9 +1583,9 @@ idle_unref_context_event (EphyWindow *window) return FALSE; } -static void -set_context_event (EphyWindow *window, - EphyEmbedEvent *event) +void +_ephy_window_set_context_event (EphyWindow *window, + EphyEmbedEvent *event) { EphyWindowPrivate *priv = window->priv; @@ -1603,19 +1603,11 @@ set_context_event (EphyWindow *window, priv->context_event = event != NULL ? g_object_ref (event) : NULL; } -static void -embed_popup_deactivate_cb (GtkWidget *popup, - EphyWindow *window) +void +_ephy_window_unset_context_event (EphyWindow *window) { EphyWindowPrivate *priv = window->priv; - LOG ("Deactivating popup menu"); - - enable_edit_actions_sensitivity (window); - - g_signal_handlers_disconnect_by_func - (popup, G_CALLBACK (embed_popup_deactivate_cb), window); - /* Unref the event from idle since we still need it * from the action callbacks which will run before idle. */ @@ -1626,6 +1618,22 @@ embed_popup_deactivate_cb (GtkWidget *popup, } } +static void +embed_popup_deactivate_cb (GtkWidget *popup, + EphyWindow *window) +{ + EphyWindowPrivate *priv = window->priv; + + LOG ("Deactivating popup menu"); + + enable_edit_actions_sensitivity (window); + + g_signal_handlers_disconnect_by_func + (popup, G_CALLBACK (embed_popup_deactivate_cb), window); + + _ephy_window_unset_context_event (window); +} + static char * get_name_from_address_value (const GValue *value) { @@ -1825,7 +1833,7 @@ show_embed_popup (EphyWindow *window, action = gtk_action_group_get_action (action_group, "OpenLinkInNewTab"); ephy_action_change_sensitivity_flags (action, SENS_FLAG_CONTEXT, !can_open_in_new); - set_context_event (window, event); + _ephy_window_set_context_event (window, event); g_signal_connect (widget, "deactivate", G_CALLBACK (embed_popup_deactivate_cb), window); @@ -2439,7 +2447,7 @@ ephy_window_dispose (GObject *object) g_object_unref (priv->manager); priv->manager = NULL; - set_context_event (window, NULL); + _ephy_window_set_context_event (window, NULL); } destroy_fullscreen_popup (window); -- cgit v1.2.3