aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-gui.c13
-rw-r--r--lib/ephy-gui.h5
2 files changed, 14 insertions, 4 deletions
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index 65e0b0de6..2e2d355c1 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -40,14 +40,19 @@
GtkStyle *loading_text_style = NULL;
GtkStyle *new_text_style = NULL;
-static void
-sanitize_popup_position (GtkWidget *widget, GtkMenu *menu, gint *x, gint *y)
+void
+ephy_gui_sanitise_popup_position (GtkMenu *menu,
+ GtkWidget *widget,
+ gint *x,
+ gint *y)
{
GdkScreen *screen = gtk_widget_get_screen (widget);
gint monitor_num;
GdkRectangle monitor;
GtkRequisition req;
+ g_return_if_fail (widget != NULL);
+
gtk_widget_size_request (GTK_WIDGET (menu), &req);
monitor_num = gdk_screen_get_monitor_at_point (screen, *x, *y);
@@ -92,7 +97,7 @@ ephy_gui_menu_position_tree_selection (GtkMenu *menu,
g_list_free (selected_rows);
}
- sanitize_popup_position (widget, menu, x, y);
+ ephy_gui_sanitise_popup_position (menu, widget, x, y);
}
/**
@@ -125,7 +130,7 @@ ephy_gui_menu_position_under_widget (GtkMenu *menu,
*y += w->allocation.y + w->allocation.height;
- sanitize_popup_position (w, menu, x, y);
+ ephy_gui_sanitise_popup_position (menu, w, x, y);
}
gboolean
diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h
index 0c9c5a04c..caa4035d8 100644
--- a/lib/ephy-gui.h
+++ b/lib/ephy-gui.h
@@ -30,6 +30,11 @@
G_BEGIN_DECLS
+void ephy_gui_sanitise_popup_position (GtkMenu *menu,
+ GtkWidget *parent_widget,
+ gint *x,
+ gint *y);
+
void ephy_gui_menu_position_tree_selection (GtkMenu *menu,
gint *x,
gint *y,