diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-03-23 20:43:28 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2016-03-24 19:17:12 +0200 |
commit | 7e5058da54d8043d1288b7ff8fd234c2ca6ccbd8 (patch) | |
tree | 844398d8ea9683f3eaee7980aabbbf89216cf15c /libmetacity/meta-theme-impl.c | |
parent | 643ce3e12598e7347f23bd9116b82d6609249b95 (diff) | |
download | metacity-7e5058da54d8043d1288b7ff8fd234c2ca6ccbd8.tar.gz |
libmetacity: add get_window_scaling_factor
Based on mutter commit:
https://git.gnome.org/browse/mutter/commit/?id=57c1078ee742d9f01e80e7fe05c88adfec4b4ac3
Diffstat (limited to 'libmetacity/meta-theme-impl.c')
-rw-r--r-- | libmetacity/meta-theme-impl.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libmetacity/meta-theme-impl.c b/libmetacity/meta-theme-impl.c index b16d5ead..1002adfc 100644 --- a/libmetacity/meta-theme-impl.c +++ b/libmetacity/meta-theme-impl.c @@ -308,3 +308,19 @@ scale_border (GtkBorder *border, border->top *= factor; border->bottom *= factor; } + +int +get_window_scaling_factor (void) +{ + GdkScreen *screen; + GValue value = G_VALUE_INIT; + + screen = gdk_screen_get_default (); + + g_value_init (&value, G_TYPE_INT); + + if (gdk_screen_get_setting (screen, "gdk-window-scaling-factor", &value)) + return g_value_get_int (&value); + else + return 1; +} |