summaryrefslogtreecommitdiff
path: root/capplets/appearance/appearance-font.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-01-25 20:05:44 -0500
committerMartin Wimpress <[email protected]>2018-01-26 01:05:44 +0000
commit312edc87dae270e11ce2955c7c26b3387ae94985 (patch)
treeed388cde735bdd2c6c0a95ad21b7d079a5cb1c9f /capplets/appearance/appearance-font.c
parentf9dfd6fa92e33bb0374b2b1b6f37d391f14c929f (diff)
downloadmate-control-center-312edc87dae270e11ce2955c7c26b3387ae94985.tar.bz2
mate-control-center-312edc87dae270e11ce2955c7c26b3387ae94985.tar.xz
Add support for HiDPI displays (#325)
* Support font auto-scaling for HiDPI displays * Use nicer-looking numbers for DPI, since the spinner only supports integers * Remove ceil for scaled DPI
Diffstat (limited to 'capplets/appearance/appearance-font.c')
-rw-r--r--capplets/appearance/appearance-font.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/capplets/appearance/appearance-font.c b/capplets/appearance/appearance-font.c
index 0df8d4eb..cd1a4e54 100644
--- a/capplets/appearance/appearance-font.c
+++ b/capplets/appearance/appearance-font.c
@@ -422,6 +422,7 @@ get_dpi_from_x_server (void)
{
GdkScreen *screen;
double dpi;
+ gint scale;
screen = gdk_screen_get_default ();
@@ -443,6 +444,10 @@ get_dpi_from_x_server (void)
dpi = DPI_FALLBACK;
}
+ scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+ if (scale)
+ dpi = dpi * scale;
+
return dpi;
}