Skip to content

Commit 3630b20

Browse files
wmwwraveit65
authored and
raveit65
committed
applet.c: Remove unused mate_panel_applet_position_menu ()
1 parent d3ad5dc commit 3630b20

File tree

2 files changed

+0
-79
lines changed

2 files changed

+0
-79
lines changed

mate-panel/applet.c

-74
Original file line numberDiff line numberDiff line change
@@ -636,80 +636,6 @@ mate_panel_applet_menu_set_recurse (GtkMenu *menu,
636636
g_list_free (children);
637637
}
638638

639-
void
640-
mate_panel_applet_position_menu (GtkMenu *menu,
641-
int *x,
642-
int *y,
643-
gboolean *push_in,
644-
GtkWidget *applet)
645-
{
646-
GtkAllocation allocation;
647-
GtkRequisition requisition;
648-
GdkDevice *device;
649-
GdkScreen *screen;
650-
GtkWidget *parent;
651-
int menu_x = 0;
652-
int menu_y = 0;
653-
int pointer_x;
654-
int pointer_y;
655-
656-
parent = gtk_widget_get_parent (applet);
657-
658-
g_return_if_fail (PANEL_IS_WIDGET (parent));
659-
660-
screen = gtk_widget_get_screen (applet);
661-
662-
gtk_widget_get_preferred_size (GTK_WIDGET (menu), &requisition, NULL);
663-
664-
gdk_window_get_origin (gtk_widget_get_window (applet), &menu_x, &menu_y);
665-
666-
device = gdk_seat_get_pointer (gdk_display_get_default_seat (gtk_widget_get_display (applet)));
667-
gdk_window_get_device_position (gtk_widget_get_window (applet), device, &pointer_x, &pointer_y, NULL);
668-
669-
gtk_widget_get_allocation (applet, &allocation);
670-
671-
if (!gtk_widget_get_has_window (applet)) {
672-
menu_x += allocation.x;
673-
menu_y += allocation.y;
674-
}
675-
676-
if (PANEL_WIDGET (parent)->orient == GTK_ORIENTATION_HORIZONTAL) {
677-
if (gtk_widget_get_direction (GTK_WIDGET (menu)) != GTK_TEXT_DIR_RTL) {
678-
if (pointer_x < allocation.width &&
679-
requisition.width < pointer_x)
680-
menu_x += MIN (pointer_x,
681-
allocation.width - requisition.width);
682-
} else {
683-
menu_x += allocation.width - requisition.width;
684-
if (pointer_x > 0 && pointer_x < allocation.width &&
685-
pointer_x < allocation.width - requisition.width) {
686-
menu_x -= MIN (allocation.width - pointer_x,
687-
allocation.width - requisition.width);
688-
}
689-
}
690-
menu_x = MIN (menu_x, WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.width);
691-
692-
if (menu_y > HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / 2)
693-
menu_y -= requisition.height;
694-
else
695-
menu_y += allocation.height;
696-
} else {
697-
if (pointer_y < allocation.height &&
698-
requisition.height < pointer_y)
699-
menu_y += MIN (pointer_y, allocation.height - requisition.height);
700-
menu_y = MIN (menu_y, HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.height);
701-
702-
if (menu_x > WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / 2)
703-
menu_x -= requisition.width;
704-
else
705-
menu_x += allocation.width;
706-
}
707-
708-
*x = menu_x;
709-
*y = menu_y;
710-
*push_in = FALSE;
711-
}
712-
713639
static void
714640
applet_show_menu (AppletInfo *info,
715641
GdkEventButton *event)

mate-panel/applet.h

-5
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ void mate_panel_applet_menu_set_recurse (GtkMenu *menu,
111111

112112
gboolean mate_panel_applet_toggle_locked (AppletInfo *info);
113113

114-
void mate_panel_applet_position_menu (GtkMenu *menu,
115-
int *x,
116-
int *y,
117-
gboolean *push_in,
118-
GtkWidget *applet);
119114
#ifdef __cplusplus
120115
}
121116
#endif

0 commit comments

Comments
 (0)