summaryrefslogtreecommitdiff
path: root/plugins/a11y-keyboard
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-01-25 20:05:18 -0500
committerMartin Wimpress <[email protected]>2018-01-26 01:05:18 +0000
commiteaad50f7624c8946e57ca075f8b7e383b1715bcc (patch)
treedec5148045765ee369fbec58e19bee094d46b869 /plugins/a11y-keyboard
parent6ce8e3732215cc813597496001fa23b37f3d5bf3 (diff)
downloadmate-settings-daemon-eaad50f7624c8946e57ca075f8b7e383b1715bcc.tar.bz2
mate-settings-daemon-eaad50f7624c8946e57ca075f8b7e383b1715bcc.tar.xz
Add support for HiDPI displays (#208)
* Support font size and mouse cursor auto-scaling for HiDPI displays * Fix where DPI is getting scaled * Remove ceil for scaled DPI
Diffstat (limited to 'plugins/a11y-keyboard')
-rw-r--r--plugins/a11y-keyboard/msd-a11y-preferences-dialog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c b/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c
index 165d5b0..185b8c9 100644
--- a/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c
+++ b/plugins/a11y-keyboard/msd-a11y-preferences-dialog.c
@@ -173,6 +173,7 @@ get_dpi_from_x_server (void)
{
GdkScreen *screen;
double dpi;
+ int scale;
screen = gdk_screen_get_default ();
if (screen != NULL) {
@@ -181,6 +182,7 @@ get_dpi_from_x_server (void)
Screen *xscreen = gdk_x11_screen_get_xscreen (screen);
+ scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
width_dpi = dpi_from_pixels_and_mm (WidthOfScreen (xscreen), WidthMMOfScreen (xscreen));
height_dpi = dpi_from_pixels_and_mm (HeightOfScreen (xscreen), HeightMMOfScreen (xscreen));
@@ -192,6 +194,9 @@ get_dpi_from_x_server (void)
} else {
dpi = (width_dpi + height_dpi) / 2.0;
}
+
+ dpi *= scale;
+
} else {
/* Huh!? No screen? */
dpi = DPI_DEFAULT;