aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-11-08 04:28:22 +0800
committerChristian Persch <chpe@src.gnome.org>2004-11-08 04:28:22 +0800
commit57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045 (patch)
treec9a16dc1690574c7254f8a83246f3c530548f7f4 /src
parentc9bb2e2c7f9db1ee1a6cf684e2f51c110cfa868c (diff)
downloadgsoc2013-epiphany-57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045.tar
gsoc2013-epiphany-57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045.tar.gz
gsoc2013-epiphany-57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045.tar.bz2
gsoc2013-epiphany-57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045.tar.lz
gsoc2013-epiphany-57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045.tar.xz
gsoc2013-epiphany-57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045.tar.zst
gsoc2013-epiphany-57608f0c8f6bf6b753387f43f3cf0f9d9b8ed045.zip
Sanitise the embed popup position. Fixes bug #157162.
2004-11-07 Christian Persch <chpe@cvs.gnome.org> * lib/ephy-gui.c: (ephy_gui_sanitise_popup_position), (ephy_gui_menu_position_tree_selection), (ephy_gui_menu_position_under_widget): * lib/ephy-gui.h: * src/ephy-window.c: (popup_menu_at_coords), (show_embed_popup): Sanitise the embed popup position. Fixes bug #157162.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-window.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index bfb6e0855..5e53ceb00 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1528,10 +1528,17 @@ static void
popup_menu_at_coords (GtkMenu *menu, gint *x, gint *y, gboolean *push_in,
gpointer user_data)
{
- EphyEmbedEvent *event = (EphyEmbedEvent *) user_data;
+ GtkWidget *window = GTK_WIDGET (user_data);
+ EphyEmbedEvent *event;
+
+ event = g_object_get_data (G_OBJECT (window), "context_event");
+ g_return_if_fail (event != NULL);
ephy_embed_event_get_coords (event, x, y);
+ /* FIXME: better position the popup within the window bounds? */
+ ephy_gui_sanitise_popup_position (menu, window, x, y);
+
*push_in = TRUE;
}
@@ -1623,7 +1630,7 @@ show_embed_popup (EphyWindow *window, EphyTab *tab, EphyEmbedEvent *event)
if (type == EPHY_EMBED_EVENT_KEY)
{
gtk_menu_popup (GTK_MENU (widget), NULL, NULL,
- popup_menu_at_coords, event, 0,
+ popup_menu_at_coords, window, 0,
gtk_get_current_event_time ());
gtk_menu_shell_select_first (GTK_MENU_SHELL (widget), FALSE);
}