diff options
author | ZenWalker <scow@riseup.net> | 2017-08-08 22:21:31 +0200 |
---|---|---|
committer | ZenWalker <scow@riseup.net> | 2017-08-08 22:21:31 +0200 |
commit | f748d5794f02d02ba949ad1503ed72207efca40c (patch) | |
tree | e77a698c24cbc3745279178547db4a746d33da05 /src/msd-osd-window.c | |
parent | 0aebbd9548603e170a45e5ce7dac271a393c8b0a (diff) | |
download | mate-power-manager-f748d5794f02d02ba949ad1503ed72207efca40c.tar.bz2 mate-power-manager-f748d5794f02d02ba949ad1503ed72207efca40c.tar.xz |
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'src/msd-osd-window.c')
-rw-r--r-- | src/msd-osd-window.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/msd-osd-window.c b/src/msd-osd-window.c index 11c26d7..e0086fb 100644 --- a/src/msd-osd-window.c +++ b/src/msd-osd-window.c @@ -444,6 +444,7 @@ msd_osd_window_init (MsdOsdWindow *window) if (window->priv->is_composited) { gdouble scalew, scaleh, scale; + gint sc_width, sc_height; gint size; gtk_window_set_decorated (GTK_WINDOW (window), FALSE); @@ -453,8 +454,12 @@ msd_osd_window_init (MsdOsdWindow *window) gtk_style_context_add_class (style, "window-frame"); /* assume 130x130 on a 640x480 display and scale from there */ - scalew = gdk_screen_get_width (screen) / 640.0; - scaleh = gdk_screen_get_height (screen) / 480.0; + + gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL, + &sc_width, &sc_height); + + scalew = sc_width / 640.0; + scaleh = sc_height / 480.0; scale = MIN (scalew, scaleh); size = 130 * MAX (1, scale); |