aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-23 23:38:02 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-23 23:38:02 +0800
commit361ed3d1c475f7b1ab2226abf7605405411ab185 (patch)
tree331891b90297d0d93026d2ca15b86570b634fc1e /src
parent8f10d345ad4bebf6a99c8a62e2448f49338eeb33 (diff)
downloadgsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.gz
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.bz2
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.lz
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.xz
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.tar.zst
gsoc2013-epiphany-361ed3d1c475f7b1ab2226abf7605405411ab185.zip
Check for broken context event button.
2005-01-23 Christian Persch <chpe@cvs.gnome.org> * configure.ac: Check for broken context event button. * embed/ephy-embed-event.c: (ephy_embed_event_get_context), (ephy_embed_event_get_button): * embed/ephy-embed-event.h: * embed/mozilla/mozilla-embed-event.cpp: * embed/mozilla/mozilla-embed-event.h: Change get_type to get_button, and don't store a nsCOMPtr in .priv. * src/ephy-tab.c: (ephy_tab_dom_mouse_click_cb): * src/ephy-window.c: (show_embed_popup), (tab_context_menu_cb), (ephy_window_set_active_tab): Adapted for above change. * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: Attach listener to oncontextmenu event. * embed/mozilla/EventContext.cpp: * embed/mozilla/EventContext.h: Get event target coordinates also for 'mouse' context events. * embed/mozilla/mozilla-embed.cpp: Remove key-down handler, and context code from mouse-down handler.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-tab.c13
-rw-r--r--src/ephy-window.c16
2 files changed, 12 insertions, 17 deletions
diff --git a/src/ephy-tab.c b/src/ephy-tab.c
index 4b297e5b1..11ec9168a 100644
--- a/src/ephy-tab.c
+++ b/src/ephy-tab.c
@@ -1521,9 +1521,8 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed,
EphyEmbedEvent *event,
EphyTab *tab)
{
- EphyEmbedEventType type;
EphyEmbedEventContext context;
- guint modifier;
+ guint button, modifier;
gboolean handled = TRUE;
gboolean with_control, with_shift, is_left_click, is_middle_click;
gboolean is_link, is_image, is_middle_clickable;
@@ -1532,17 +1531,17 @@ ephy_tab_dom_mouse_click_cb (EphyEmbed *embed,
g_return_val_if_fail (EPHY_IS_EMBED_EVENT(event), FALSE);
- type = ephy_embed_event_get_event_type (event);
+ button = ephy_embed_event_get_button (event);
context = ephy_embed_event_get_context (event);
modifier = ephy_embed_event_get_modifier (event);
- LOG ("ephy_tab_dom_mouse_click_cb: type %d, context %x, modifier %x",
- type, context, modifier)
+ LOG ("ephy_tab_dom_mouse_click_cb: button %d, context %x, modifier %x",
+ button, context, modifier)
with_control = (modifier & GDK_CONTROL_MASK) != 0;
with_shift = (modifier & GDK_SHIFT_MASK) != 0;
- is_left_click = (type == EPHY_EMBED_EVENT_MOUSE_BUTTON1);
- is_middle_click = (type == EPHY_EMBED_EVENT_MOUSE_BUTTON2);
+ is_left_click = (button == 1);
+ is_middle_click = (button == 2);
middle_click_opens =
eel_gconf_get_boolean (CONF_INTERFACE_MIDDLE_CLICK_OPEN_URL) &&
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 2760e59fb..bd97d29e2 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1715,7 +1715,7 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event)
const GValue *value;
gboolean framed, has_background, can_open_in_new;
GtkWidget *widget;
- EphyEmbedEventType type;
+ guint button;
/* Do not show the menu in print preview mode */
if (window->priv->ppv_mode)
@@ -1796,8 +1796,8 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event)
g_signal_connect (widget, "hide",
G_CALLBACK (hide_embed_popup_cb), window);
- type = ephy_embed_event_get_event_type (event);
- if (type == EPHY_EMBED_EVENT_KEY)
+ button = ephy_embed_event_get_button (event);
+ if (button == 0)
{
gtk_menu_popup (GTK_MENU (widget), NULL, NULL,
popup_menu_at_coords, window, 0,
@@ -1807,7 +1807,7 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event)
else
{
gtk_menu_popup (GTK_MENU (widget), NULL, NULL,
- NULL, NULL, 2,
+ NULL, NULL, button,
gtk_get_current_event_time ());
}
}
@@ -1819,17 +1819,13 @@ tab_context_menu_cb (EphyEmbed *embed,
{
EphyTab *tab;
- g_return_val_if_fail (EPHY_IS_WINDOW (window), FALSE);
- g_return_val_if_fail (EPHY_IS_EMBED (embed), FALSE);
- g_return_val_if_fail (EPHY_IS_EMBED_EVENT(event), FALSE);
-
tab = ephy_tab_for_embed (embed);
g_return_val_if_fail (EPHY_IS_TAB (tab), FALSE);
g_return_val_if_fail (window->priv->active_tab == tab, FALSE);
show_embed_popup (window, tab, event);
- return FALSE;
+ return TRUE;
}
static void
@@ -1963,7 +1959,7 @@ ephy_window_set_active_tab (EphyWindow *window, EphyTab *new_tab)
embed = ephy_tab_get_embed (new_tab);
g_signal_connect_object (embed, "ge_context_menu",
G_CALLBACK (tab_context_menu_cb),
- window, 0);
+ window, G_CONNECT_AFTER);
action = GTK_TOGGLE_ACTION (ephy_tab_get_action (new_tab));
gtk_toggle_action_set_active (action, TRUE);