diff options
author | Руслан Ижбулатов <lrn1986@gmail.com> | 2014-07-31 14:03:00 +0000 |
---|---|---|
committer | Руслан Ижбулатов <lrn1986@gmail.com> | 2014-07-31 14:27:14 +0000 |
commit | a235dd6a6cd36be27b12078340e2334037fb300b (patch) | |
tree | b3bc23230233eab3f5c2b3c0bef807ab08e2409f | |
parent | f38498ed841f6e63b1904e92be48c9f5f429bd31 (diff) | |
download | gtk+-a235dd6a6cd36be27b12078340e2334037fb300b.tar.gz |
GDK W32: add environment variable to override system font scaling
Support environment variable GDK_WIN32_FONT_RESOLUTION that can be set to
a desired dpi (72, 96, 130, etc) to override system settings. Useful for
debugging, since changing system font scaling requires the user to log off
and log on again.
https://bugzilla.gnome.org/show_bug.cgi?id=734038
-rw-r--r-- | gdk/win32/gdkscreen-win32.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c index f86d7ce0ab..8c6fb03400 100644 --- a/gdk/win32/gdkscreen-win32.c +++ b/gdk/win32/gdkscreen-win32.c @@ -39,6 +39,7 @@ gdk_win32_screen_init (GdkWin32Screen *display) GdkScreen *screen = GDK_SCREEN (display); HDC screen_dc; int logpixelsx = -1; + const gchar *font_resolution; screen_dc = GetDC (NULL); @@ -48,6 +49,14 @@ gdk_win32_screen_init (GdkWin32Screen *display) ReleaseDC (NULL, screen_dc); } + font_resolution = g_getenv ("GDK_WIN32_FONT_RESOLUTION"); + if (font_resolution) + { + int env_logpixelsx = atol (font_resolution); + if (env_logpixelsx > 0) + logpixelsx = env_logpixelsx; + } + if (logpixelsx > 0) _gdk_screen_set_resolution (screen, logpixelsx); } |