diff options
Diffstat (limited to 'mate-panel/applet.c')
-rw-r--r-- | mate-panel/applet.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/mate-panel/applet.c b/mate-panel/applet.c index 86399908..13f31d7e 100644 --- a/mate-panel/applet.c +++ b/mate-panel/applet.c @@ -641,8 +641,6 @@ mate_panel_applet_position_menu (GtkMenu *menu, int menu_y = 0; int pointer_x; int pointer_y; - int screen_width; - int screen_height; parent = gtk_widget_get_parent (applet); @@ -667,9 +665,6 @@ mate_panel_applet_position_menu (GtkMenu *menu, menu_y += allocation.y; } - gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, - &screen_width, &screen_height); - 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 && @@ -684,9 +679,9 @@ mate_panel_applet_position_menu (GtkMenu *menu, allocation.width - requisition.width); } } - menu_x = MIN (menu_x, screen_width - requisition.width); + menu_x = MIN (menu_x, WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.width); - if (menu_y > screen_height / 2) + if (menu_y > HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / 2) menu_y -= requisition.height; else menu_y += allocation.height; @@ -694,9 +689,9 @@ mate_panel_applet_position_menu (GtkMenu *menu, if (pointer_y < allocation.height && requisition.height < pointer_y) menu_y += MIN (pointer_y, allocation.height - requisition.height); - menu_y = MIN (menu_y, screen_height - requisition.height); + menu_y = MIN (menu_y, HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) - requisition.height); - if (menu_x > screen_width / 2) + if (menu_x > WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / 2) menu_x -= requisition.width; else menu_x += allocation.width; |