summaryrefslogtreecommitdiff
path: root/src/mate-screensaver-preferences.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-10 02:02:48 +0200
committerZenWalker <[email protected]>2017-08-10 02:02:48 +0200
commit816394c1a6ce9968dba3e1b0ecc884c8ccca4d43 (patch)
treecc3d7609ed335e979d5d23afcb60609f2f645cbb /src/mate-screensaver-preferences.c
parenta96cc1c494032c740b5ebda705992213609fbb18 (diff)
downloadmate-screensaver-816394c1a6ce9968dba3e1b0ecc884c8ccca4d43.tar.bz2
mate-screensaver-816394c1a6ce9968dba3e1b0ecc884c8ccca4d43.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'src/mate-screensaver-preferences.c')
-rw-r--r--src/mate-screensaver-preferences.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
index a3ba973..d3a11a7 100644
--- a/src/mate-screensaver-preferences.c
+++ b/src/mate-screensaver-preferences.c
@@ -1215,9 +1215,13 @@ constrain_list_size (GtkWidget *widget,
{
GtkRequisition req;
int max_height;
+ int sc_height;
/* constrain height to be the tree height up to a max */
- max_height = (gdk_screen_get_height (gtk_widget_get_screen (widget))) / 4;
+ gdk_window_get_geometry (gdk_screen_get_root_window (gtk_widget_get_screen (widget)),
+ NULL, NULL, NULL, &sc_height);
+
+ max_height = sc_height / 4;
gtk_widget_get_preferred_size (to_size, &req, NULL);
allocation->height = MIN (req.height, max_height);