From d894ddd17e0e46a5cb27a5f851c89f1829cb844a Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sun, 17 Dec 2017 01:11:18 +0100 Subject: WidthOfScreen and HeightOfScreen implementation This commit reverts: https://github.com/mate-desktop/mate-desktop/commit/6137212bce120c9eb5555ae777fc7fea2f71e43e And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height --- libmate-desktop/mate-colorsel.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libmate-desktop/mate-colorsel.c') diff --git a/libmate-desktop/mate-colorsel.c b/libmate-desktop/mate-colorsel.c index cea7d3b..851f9cd 100644 --- a/libmate-desktop/mate-colorsel.c +++ b/libmate-desktop/mate-colorsel.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -1306,7 +1307,6 @@ popup_position_func (GtkMenu *menu, GtkRequisition req; gint root_x, root_y; GdkScreen *screen; - gint sc_width, sc_height; GtkAllocation allocation; widget = GTK_WIDGET (user_data); @@ -1324,12 +1324,8 @@ popup_position_func (GtkMenu *menu, /* Ensure sanity */ screen = gtk_widget_get_screen (widget); - - gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, - &sc_width, &sc_height); - - *x = CLAMP (*x, 0, MAX (0, sc_width - req.width)); - *y = CLAMP (*y, 0, MAX (0, sc_height - req.height)); + *x = CLAMP (*x, 0, MAX (0, WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) - req.width)); + *y = CLAMP (*y, 0, MAX (0, HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) - req.height)); } static void -- cgit v1.2.1