summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-colorsel.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-08 20:47:05 +0200
committerraveit65 <[email protected]>2017-08-16 22:20:50 +0200
commit6137212bce120c9eb5555ae777fc7fea2f71e43e (patch)
tree0642e60e10f8583cbe7e4880d31ec5f0a279f1df /libmate-desktop/mate-colorsel.c
parent0e2e562d78ead7e685e6a01749571ee5234fbf2c (diff)
downloadmate-desktop-6137212bce120c9eb5555ae777fc7fea2f71e43e.tar.bz2
mate-desktop-6137212bce120c9eb5555ae777fc7fea2f71e43e.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'libmate-desktop/mate-colorsel.c')
-rw-r--r--libmate-desktop/mate-colorsel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmate-desktop/mate-colorsel.c b/libmate-desktop/mate-colorsel.c
index 7382c17..cea7d3b 100644
--- a/libmate-desktop/mate-colorsel.c
+++ b/libmate-desktop/mate-colorsel.c
@@ -1306,6 +1306,7 @@ 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);
@@ -1323,8 +1324,12 @@ popup_position_func (GtkMenu *menu,
/* Ensure sanity */
screen = gtk_widget_get_screen (widget);
- *x = CLAMP (*x, 0, MAX (0, gdk_screen_get_width (screen) - req.width));
- *y = CLAMP (*y, 0, MAX (0, gdk_screen_get_height (screen) - req.height));
+
+ 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));
}
static void