From c9c02fe5df78195e910e3a3fcc39f5b40138fb0a Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 11 Mar 2010 11:55:00 +0000 Subject: [PATCH] More accurate helper to position popup menus --- src/panel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/panel.c b/src/panel.c index e19e429..913531c 100644 --- a/src/panel.c +++ b/src/panel.c @@ -299,6 +299,7 @@ static void _panel_helper_position_menu(GtkMenu * menu, gint * x, gint * y, { Panel * panel = data; GtkRequisition req; + gint height; gtk_widget_size_request(GTK_WIDGET(menu), &req); #ifdef DEBUG @@ -308,8 +309,8 @@ static void _panel_helper_position_menu(GtkMenu * menu, gint * x, gint * y, if(req.height <= 0) return; *x = PANEL_BORDER_WIDTH; - *y = panel->root_height - (PANEL_BORDER_WIDTH * 8) - panel->icon_height - - req.height; + gtk_window_get_size(GTK_WINDOW(panel->window), NULL, &height); + *y = panel->root_height - height - req.height; *push_in = TRUE; }