summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mate-panel/applet.c74
-rw-r--r--mate-panel/applet.h5
2 files changed, 0 insertions, 79 deletions
diff --git a/mate-panel/applet.c b/mate-panel/applet.c
index bf552b71..8a3c4ffc 100644
--- a/mate-panel/applet.c
+++ b/mate-panel/applet.c
@@ -636,80 +636,6 @@ mate_panel_applet_menu_set_recurse (GtkMenu *menu,
g_list_free (children);
}
-void
-mate_panel_applet_position_menu (GtkMenu *menu,
- int *x,
- int *y,
- gboolean *push_in,
- GtkWidget *applet)
-{
- GtkAllocation allocation;
- GtkRequisition requisition;
- GdkDevice *device;
- GdkScreen *screen;
- GtkWidget *parent;
- int menu_x = 0;
- int menu_y = 0;
- int pointer_x;
- int pointer_y;
-
- parent = gtk_widget_get_parent (applet);
-
- g_return_if_fail (PANEL_IS_WIDGET (parent));
-
- screen = gtk_widget_get_screen (applet);
-
- gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
-
- gdk_window_get_origin (gtk_widget_get_window (applet), &menu_x, &menu_y);
-
- device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (applet)));
- gdk_window_get_device_position (gtk_widget_get_window (applet), device, &pointer_x, &pointer_y, NULL);
-
- gtk_widget_get_allocation (applet, &allocation);
-
- if (!gtk_widget_get_has_window (applet)) {
- menu_x += allocation.x;
- menu_y += allocation.y;
- }
-
- if (PANEL_WIDGET (parent)->orient == GTK_ORIENTATION_HORIZONTAL) {
- if (gtk_widget_get_direction (GTK_WIDGET (menu)) != GTK_TEXT_DIR_RTL) {
- if (pointer_x < allocation.width &&
- requisition.width < pointer_x)
- menu_x += MIN (pointer_x,
- allocation.width - requisition.width);
- } else {
- menu_x += allocation.width - requisition.width;
- if (pointer_x > 0 && pointer_x < allocation.width &&
- pointer_x < allocation.width - requisition.width) {
- menu_x -= MIN (allocation.width - pointer_x,
- allocation.width - requisition.width);
- }
- }
- menu_x = MIN (menu_x, WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.width);
-
- if (menu_y > HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / 2)
- menu_y -= requisition.height;
- else
- menu_y += allocation.height;
- } else {
- if (pointer_y < allocation.height &&
- requisition.height < pointer_y)
- menu_y += MIN (pointer_y, allocation.height - requisition.height);
- menu_y = MIN (menu_y, HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.height);
-
- if (menu_x > WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / 2)
- menu_x -= requisition.width;
- else
- menu_x += allocation.width;
- }
-
- *x = menu_x;
- *y = menu_y;
- *push_in = FALSE;
-}
-
static void
applet_show_menu (AppletInfo *info,
GdkEventButton *event)
diff --git a/mate-panel/applet.h b/mate-panel/applet.h
index 50205c8f..380e1f21 100644
--- a/mate-panel/applet.h
+++ b/mate-panel/applet.h
@@ -111,11 +111,6 @@ void mate_panel_applet_menu_set_recurse (GtkMenu *menu,
gboolean mate_panel_applet_toggle_locked (AppletInfo *info);
-void mate_panel_applet_position_menu (GtkMenu *menu,
- int *x,
- int *y,
- gboolean *push_in,
- GtkWidget *applet);
#ifdef __cplusplus
}
#endif