summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2017-12-08 01:23:29 +0100
committerPablo Barciela <[email protected]>2017-12-08 01:35:35 +0100
commit0f788aabfb3834eb9f3f4f5220aa4fce6f66d450 (patch)
tree7cf22bfab33ba72f583440900cf5c9e82f704e5f
parent59192f8be9d81650c4d0e9ee1b201a762528dde8 (diff)
downloadmate-power-manager-0f788aabfb3834eb9f3f4f5220aa4fce6f66d450.tar.bz2
mate-power-manager-0f788aabfb3834eb9f3f4f5220aa4fce6f66d450.tar.xz
WidthOfScreen and HeightOfScreen implementation
This commit reverts: https://github.com/mate-desktop/mate-power-manager/commit/f748d5794f02d02ba949ad1503ed72207efca40c And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_get_height
-rw-r--r--src/msd-osd-window.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/msd-osd-window.c b/src/msd-osd-window.c
index e0086fb..cfc426f 100644
--- a/src/msd-osd-window.c
+++ b/src/msd-osd-window.c
@@ -35,6 +35,7 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include "msd-osd-window.h"
@@ -444,7 +445,6 @@ 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);
@@ -454,12 +454,8 @@ msd_osd_window_init (MsdOsdWindow *window)
gtk_style_context_add_class (style, "window-frame");
/* assume 130x130 on a 640x480 display and scale from there */
-
- 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;
+ scalew = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / 640.0;
+ scaleh = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / 480.0;
scale = MIN (scalew, scaleh);
size = 130 * MAX (1, scale);