summaryrefslogtreecommitdiff
path: root/mate-panel/applet.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-07 20:33:08 +0200
committerlukefromdc <[email protected]>2017-08-13 14:34:57 -0400
commit7b2bc7d9f98c6ba8c2c31bdf9605faadb42a7e0e (patch)
treeb463e4d5b37eaf2e9c34b8b536c2164a6aab5a5b /mate-panel/applet.c
parent8a8ca9c24c7b4d9bec8666dd9a17c5541106bd7e (diff)
downloadmate-panel-7b2bc7d9f98c6ba8c2c31bdf9605faadb42a7e0e.tar.bz2
mate-panel-7b2bc7d9f98c6ba8c2c31bdf9605faadb42a7e0e.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'mate-panel/applet.c')
-rw-r--r--mate-panel/applet.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/mate-panel/applet.c b/mate-panel/applet.c
index 9ed853fd..85fd3ac1 100644
--- a/mate-panel/applet.c
+++ b/mate-panel/applet.c
@@ -641,6 +641,8 @@ 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);
@@ -665,6 +667,9 @@ 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 &&
@@ -679,9 +684,9 @@ mate_panel_applet_position_menu (GtkMenu *menu,
allocation.width - requisition.width);
}
}
- menu_x = MIN (menu_x, gdk_screen_get_width (screen) - requisition.width);
+ menu_x = MIN (menu_x, screen_width - requisition.width);
- if (menu_y > gdk_screen_get_height (screen) / 2)
+ if (menu_y > screen_height / 2)
menu_y -= requisition.height;
else
menu_y += allocation.height;
@@ -689,9 +694,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, gdk_screen_get_height (screen) - requisition.height);
+ menu_y = MIN (menu_y, screen_height - requisition.height);
- if (menu_x > gdk_screen_get_width (screen) / 2)
+ if (menu_x > screen_width / 2)
menu_x -= requisition.width;
else
menu_x += allocation.width;