diff options
author | Pablo Barciela <[email protected]> | 2017-12-18 09:39:13 +0100 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2017-12-18 10:15:10 +0100 |
commit | d6209ab657546e23b77eff5cb9860f76bc8eb5ca (patch) | |
tree | 9d7a4ffad0ecd9a65bafa0c354a9bec74ba5c68c /plugins/common | |
parent | 788babedafaf59d8b7a36cb0ef3b0b1f0e5f732c (diff) | |
download | mate-settings-daemon-d6209ab657546e23b77eff5cb9860f76bc8eb5ca.tar.bz2 mate-settings-daemon-d6209ab657546e23b77eff5cb9860f76bc8eb5ca.tar.xz |
WidthOfScreen and HeightOfScreen implementation
The work began with:
https://github.com/mate-desktop/mate-settings-daemon/commit/788babedafaf59d8b7a36cb0ef3b0b1f0e5f732c
This commit reverts:
https://github.com/mate-desktop/mate-settings-daemon/commit/7f887e614812ccb86f5d784e2db58bede8daa712
And it applies an alternative to fix the deprecated functions:
gdk_screen_get_width
gdk_screen_get_height
Diffstat (limited to 'plugins/common')
-rw-r--r-- | plugins/common/msd-osd-window.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/common/msd-osd-window.c b/plugins/common/msd-osd-window.c index e5dab81..3571282 100644 --- a/plugins/common/msd-osd-window.c +++ b/plugins/common/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); @@ -453,12 +453,9 @@ 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 = 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); |