[mate-settings-daemon] 06/07: debian/patches: Add 0000_hidpi.patch. HiDPI support.

Martin Wimpress flexiondotorg-guest at moszumanska.debian.org
Tue Jan 23 16:32:52 UTC 2018


This is an automated email from the git hooks/post-receive script.

flexiondotorg-guest pushed a commit to branch ubuntu/bionic
in repository mate-settings-daemon.

commit b1b98f5dbf2dfc8beb9ab8b7407afcfb7b51530d
Author: Martin Wimpress <martin.wimpress at ubuntu.com>
Date:   Tue Jan 23 12:06:38 2018 +0000

    debian/patches: Add 0000_hidpi.patch. HiDPI support.
---
 debian/patches/0000_hidpi.patch | 65 +++++++++++++++++++++++++++++++++++++++++
 debian/patches/series           |  1 +
 2 files changed, 66 insertions(+)

diff --git a/debian/patches/0000_hidpi.patch b/debian/patches/0000_hidpi.patch
new file mode 100644
index 0000000..98349de
--- /dev/null
+++ b/debian/patches/0000_hidpi.patch
@@ -0,0 +1,65 @@
+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;
+diff --git a/plugins/xsettings/msd-xsettings-manager.c b/plugins/xsettings/msd-xsettings-manager.c
+index a9635a8..ef14c78 100644
+--- a/plugins/xsettings/msd-xsettings-manager.c
++++ b/plugins/xsettings/msd-xsettings-manager.c
+@@ -302,24 +302,28 @@ xft_settings_get (MateXSettingsManager *manager,
+                   MateXftSettings *settings)
+ {
+         GSettings *mouse_gsettings;
++        GdkScreen *screen;
+         char      *antialiasing;
+         char      *hinting;
+         char      *rgba_order;
+         double     dpi;
++        int        scale;
+ 
+         mouse_gsettings = g_hash_table_lookup (manager->priv->gsettings, MOUSE_SCHEMA);
++        screen = gdk_screen_get_default();
+ 
+         antialiasing = g_settings_get_string (manager->priv->gsettings_font, FONT_ANTIALIASING_KEY);
+         hinting = g_settings_get_string (manager->priv->gsettings_font, FONT_HINTING_KEY);
+         rgba_order = g_settings_get_string (manager->priv->gsettings_font, FONT_RGBA_ORDER_KEY);
+         dpi = get_dpi_from_gsettings_or_x_server (manager->priv->gsettings_font);
++        scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+ 
+         settings->antialias = TRUE;
+         settings->hinting = TRUE;
+         settings->hintstyle = "hintslight";
+-        settings->dpi = dpi * 1024; /* Xft wants 1/1024ths of an inch */
++        settings->dpi = dpi * scale * 1024; /* Xft wants 1/1024ths of an inch */
+         settings->cursor_theme = g_settings_get_string (mouse_gsettings, CURSOR_THEME_KEY);
+-        settings->cursor_size = g_settings_get_int (mouse_gsettings, CURSOR_SIZE_KEY);
++        settings->cursor_size = scale * g_settings_get_int (mouse_gsettings, CURSOR_SIZE_KEY);
+         settings->rgba = "rgb";
+ 
+         if (rgba_order) {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8f7d3a1
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0000_hidpi.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mate/mate-settings-daemon.git



More information about the pkg-mate-commits mailing list