aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ephy-nautilus-view.c52
-rw-r--r--src/ephy-tab.c16
2 files changed, 39 insertions, 29 deletions
diff --git a/src/ephy-nautilus-view.c b/src/ephy-nautilus-view.c
index cec56630e..897d67af3 100644
--- a/src/ephy-nautilus-view.c
+++ b/src/ephy-nautilus-view.c
@@ -44,7 +44,10 @@ static void gnv_embed_new_window_cb (EphyEmbed *embed,
static void gnv_embed_link_message_cb (EphyEmbed *embed,
const char *message,
EphyNautilusView *view);
-static gint gnv_embed_dom_mouse_down_cb (EphyEmbed *embed,
+static gint gnv_embed_dom_mouse_click_cb (EphyEmbed *embed,
+ EphyEmbedEvent *event,
+ EphyNautilusView *view);
+static void gnv_embed_context_menu_cb (EphyEmbed *embed,
EphyEmbedEvent *event,
EphyNautilusView *view);
static void gnv_embed_zoom_change_cb (EphyNautilusView *embed,
@@ -195,9 +198,13 @@ ephy_nautilus_view_instance_init (EphyNautilusView *view)
GTK_SIGNAL_FUNC (gnv_embed_dom_mouse_click_cb),
view);
*/
- g_signal_connect (view->priv->embed, "ge_dom_mouse_down",
- GTK_SIGNAL_FUNC (gnv_embed_dom_mouse_down_cb),
+ g_signal_connect (view->priv->embed, "ge_dom_mouse_click",
+ GTK_SIGNAL_FUNC (gnv_embed_dom_mouse_click_cb),
view);
+ g_signal_connect (view->priv->embed, "ge_context_menu",
+ GTK_SIGNAL_FUNC (gnv_embed_context_menu_cb),
+ view);
+
/*
g_signal_connect (view->priv->embed, "ge_security_change",
GTK_SIGNAL_FUNC (gnv_embed_security_change_cb),
@@ -314,29 +321,19 @@ ephy_nautilus_view_class_init (EphyNautilusViewClass *class)
G_OBJECT_CLASS (class)->finalize = ephy_nautilus_view_finalize;
}
-
-
static gint
-gnv_embed_dom_mouse_down_cb (EphyEmbed *embed,
- EphyEmbedEvent *event,
- EphyNautilusView *view)
+gnv_embed_dom_mouse_click_cb (EphyEmbed *embed,
+ EphyEmbedEvent *event,
+ EphyNautilusView *view)
{
- EphyNautilusViewPrivate *p = view->priv;
- int button;
+ EphyEmbedEventType type;
EmbedEventContext context;
- ephy_embed_event_get_mouse_button (event, &button);
- ephy_embed_event_get_context (event, &context);
+ ephy_embed_event_get_event_type (event, &type);
+ ephy_embed_event_get_context (event, &context);
- if (button == 2)
- {
- ephy_embed_popup_set_event (EPHY_EMBED_POPUP (p->popup), event);
- ephy_embed_popup_show (EPHY_EMBED_POPUP (p->popup), embed);
- return TRUE;
-
- }
- else if (button == 1
- && (context & EMBED_CONTEXT_LINK))
+ if (type == EPHY_EMBED_EVENT_MOUSE_BUTTON2
+ && (context & EMBED_CONTEXT_LINK))
{
const GValue *value;
const gchar *url;
@@ -353,6 +350,19 @@ gnv_embed_dom_mouse_down_cb (EphyEmbed *embed,
}
static void
+gnv_embed_context_menu_cb (EphyEmbed *embed,
+ EphyEmbedEvent *event,
+ EphyNautilusView *view)
+{
+ EphyNautilusViewPrivate *p = view->priv;
+ EmbedEventContext context;
+
+ ephy_embed_event_get_context (event, &context);
+ ephy_embed_popup_set_event (EPHY_EMBED_POPUP (p->popup), event);
+ ephy_embed_popup_show (EPHY_EMBED_POPUP (p->popup), embed);
+}
+
+static void
gnv_embed_link_message_cb (EphyEmbed *embed, const char *message, EphyNautilusView *view)
{
g_return_if_fail (EPHY_IS_NAUTILUS_VIEW (view));
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 106c79566..35a50e712 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -956,7 +956,7 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed,
EphyTab *tab)
{
EphyWindow *window;
- int button;
+ EphyEmbedEventType type;
EmbedEventContext context;
g_assert (IS_EPHY_EMBED_EVENT(event));
@@ -964,10 +964,10 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed,
window = ephy_tab_get_window (tab);
g_return_val_if_fail (window != NULL, FALSE);
- ephy_embed_event_get_mouse_button (event, &button);
+ ephy_embed_event_get_event_type (event, &type);
ephy_embed_event_get_context (event, &context);
- if (button == 1
+ if (type == EPHY_EMBED_EVENT_MOUSE_BUTTON2
&& (context & EMBED_CONTEXT_LINK))
{
const GValue *value;
@@ -977,7 +977,7 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed,
g_value_get_string (value),
EPHY_NEW_TAB_OPEN_PAGE);
}
- else if (button == 1 &&
+ else if (type == EPHY_EMBED_EVENT_MOUSE_BUTTON2 &&
eel_gconf_get_boolean (CONF_INTERFACE_MIDDLE_CLICK_OPEN_URL) &&
!(context & EMBED_CONTEXT_LINK
|| context & EMBED_CONTEXT_EMAIL_LINK
@@ -999,20 +999,20 @@ ephy_tab_context_menu_cb (EphyEmbed *embed,
EphyTab *tab)
{
EphyWindow *window;
- int button;
+ EphyEmbedEventType type;
g_assert (IS_EPHY_EMBED_EVENT(event));
window = ephy_tab_get_window (tab);
g_return_val_if_fail (window != NULL, FALSE);
- ephy_embed_event_get_mouse_button (event, &button);
+ ephy_embed_event_get_event_type (event, &type);
- if (button == 2)
+ if (type == EPHY_EMBED_EVENT_MOUSE_BUTTON3)
{
ephy_tab_show_embed_popup (tab, event);
}
- else if (button == -1)
+ else
{
int x, y;