aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-tab.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-16 00:15:10 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-16 00:15:10 +0800
commitd5b5f70b1cca8ea489ca5be9900d0b47275b5a23 (patch)
treed797809cd8b2903ba01dde9b147b1a65291d5b32 /src/ephy-tab.c
parent41eafad36cb938d63f242ccd8dc2ad4988653614 (diff)
downloadgsoc2013-epiphany-d5b5f70b1cca8ea489ca5be9900d0b47275b5a23.tar
gsoc2013-epiphany-d5b5f70b1cca8ea489ca5be9900d0b47275b5a23.tar.gz
gsoc2013-epiphany-d5b5f70b1cca8ea489ca5be9900d0b47275b5a23.tar.bz2
gsoc2013-epiphany-d5b5f70b1cca8ea489ca5be9900d0b47275b5a23.tar.lz
gsoc2013-epiphany-d5b5f70b1cca8ea489ca5be9900d0b47275b5a23.tar.xz
gsoc2013-epiphany-d5b5f70b1cca8ea489ca5be9900d0b47275b5a23.tar.zst
gsoc2013-epiphany-d5b5f70b1cca8ea489ca5be9900d0b47275b5a23.zip
Shift+F10 show context menus on the embed. (Less invasive way until
2003-06-15 Marco Pesenti Gritti <marco@it.gnome.org> * embed/ephy-embed-event.c: (ephy_embed_event_init): * embed/ephy-embed-event.h: * embed/ephy-embed-popup-bw.c: (popup_menu_at_coords), (ephy_embed_popup_bw_show_impl): * embed/ephy-embed.c: (ephy_embed_base_init): * embed/ephy-embed.h: * embed/mozilla/EventContext.cpp: * embed/mozilla/EventContext.h: * embed/mozilla/mozilla-embed.cpp: * src/ephy-tab.c: (popup_menu_at_coords), (ephy_tab_show_embed_popup), (ephy_tab_context_menu_cb), (ephy_tab_init): Shift+F10 show context menus on the embed. (Less invasive way until gtkmozembed has a context_menu signal) From galeon.
Diffstat (limited to 'src/ephy-tab.c')
-rw-r--r--src/ephy-tab.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 72069955f..106c79566 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -886,6 +886,17 @@ ephy_tab_set_event (EphyTab *tab,
}
static void
+popup_menu_at_coords (GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
+ gpointer user_data)
+{
+ EphyEmbedEvent *event = user_data;
+
+ *x = event->x;
+ *y = event->y;
+ *push_in = FALSE;
+}
+
+static void
ephy_tab_show_embed_popup (EphyTab *tab, EphyEmbedEvent *event)
{
EmbedEventContext context;
@@ -935,7 +946,7 @@ ephy_tab_show_embed_popup (EphyTab *tab, EphyEmbedEvent *event)
g_return_if_fail (widget != NULL);
ephy_tab_set_event (tab, event);
- gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, 2,
+ gtk_menu_popup (GTK_MENU (widget), NULL, NULL, popup_menu_at_coords, event, 2,
gtk_get_current_event_time ());
}
@@ -983,9 +994,9 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed,
}
static gint
-ephy_tab_dom_mouse_down_cb (EphyEmbed *embed,
- EphyEmbedEvent *event,
- EphyTab *tab)
+ephy_tab_context_menu_cb (EphyEmbed *embed,
+ EphyEmbedEvent *event,
+ EphyTab *tab)
{
EphyWindow *window;
int button;
@@ -1001,6 +1012,13 @@ ephy_tab_dom_mouse_down_cb (EphyEmbed *embed,
{
ephy_tab_show_embed_popup (tab, event);
}
+ else if (button == -1)
+ {
+ int x, y;
+
+ ephy_embed_event_get_coords (event, &x, &y);
+ ephy_tab_show_embed_popup (tab, event);
+ }
return FALSE;
}
@@ -1101,8 +1119,8 @@ ephy_tab_init (EphyTab *tab)
g_signal_connect (embed, "ge_size_to",
G_CALLBACK (ephy_tab_size_to_cb),
tab);
- g_signal_connect (embed, "ge_dom_mouse_down",
- G_CALLBACK (ephy_tab_dom_mouse_down_cb),
+ g_signal_connect (embed, "ge_context_menu",
+ G_CALLBACK (ephy_tab_context_menu_cb),
tab);
g_signal_connect (embed, "ge_dom_mouse_click",
G_CALLBACK (ephy_tab_dom_mouse_click_cb),