summaryrefslogtreecommitdiff
path: root/plugins/common/msd-osd-window.c
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-08 02:14:01 +0200
committerraveit65 <[email protected]>2017-08-14 08:03:54 +0200
commit7f887e614812ccb86f5d784e2db58bede8daa712 (patch)
tree860298892997172e8a6711f33268b194881f1c17 /plugins/common/msd-osd-window.c
parentdaa0acc2088b8501c3c55134f8f21f3e853ca83d (diff)
downloadmate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.bz2
mate-settings-daemon-7f887e614812ccb86f5d784e2db58bede8daa712.tar.xz
avoid deprecated gdk_screen_get_width/height
Diffstat (limited to 'plugins/common/msd-osd-window.c')
-rw-r--r--plugins/common/msd-osd-window.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/common/msd-osd-window.c b/plugins/common/msd-osd-window.c
index 03e1ec3..e5dab81 100644
--- a/plugins/common/msd-osd-window.c
+++ b/plugins/common/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);
@@ -452,9 +453,12 @@ msd_osd_window_init (MsdOsdWindow *window)
GtkStyleContext *style = gtk_widget_get_style_context (GTK_WIDGET (window));
gtk_style_context_add_class (style, "window-frame");
+ gdk_window_get_geometry (gdk_screen_get_root_window (screen), NULL, NULL,
+ &sc_width, &sc_height);
+
/* 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;
+ scalew = sc_width / 640.0;
+ scaleh = sc_height / 480.0;
scale = MIN (scalew, scaleh);
size = 130 * MAX (1, scale);