[gtk+] Drop the GDK_DPI_SCALE variable



commit a27bfaa0a30c60794138cac013d046730f44edc7
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Oct 31 18:26:21 2017 -0400

    Drop the GDK_DPI_SCALE variable
    
    It complicates the dpi handling, and was really just a workaround
    for non-dpi aware applications when hidpi support was first introduced.

 docs/reference/gtk/x11.sgml     |   13 -------------
 gdk/wayland/gdkscreen-wayland.c |   10 ----------
 gdk/x11/xsettings-client.c      |   10 ----------
 gtk/gtksettings.c               |   10 ----------
 4 files changed, 0 insertions(+), 43 deletions(-)
---
diff --git a/docs/reference/gtk/x11.sgml b/docs/reference/gtk/x11.sgml
index 6a74ed5..b986683 100644
--- a/docs/reference/gtk/x11.sgml
+++ b/docs/reference/gtk/x11.sgml
@@ -86,19 +86,6 @@ The X11 GDK backend can be influenced with some additional environment variables
   </para>
 </formalpara>
 
-<formalpara>
-  <title><envar>GDK_DPI_SCALE</envar></title>
-
-  <para>
-    This can be useful when using scale-aware GTK+ applications together
-    with scale-unaware applications on a high-dpi display. In that case,
-    the font resolution can be doubled to make scale-unaware applications
-    readable, and <envar>GDK_DPI_SCALE=0.5</envar> can be set to compensate
-    for that in GTK+ applications which are already scaled by setting
-    <envar>GDK_SCALE=2</envar>.
-  </para>
-</formalpara>
-
 </refsect2>
 
 </refsect1>
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index 4024d98..4666c6f 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -268,19 +268,9 @@ update_xft_settings (GdkScreen *screen)
   if (screen_wayland->xft_settings.dpi != xft_settings.dpi)
     {
       double dpi = xft_settings.dpi / 1024.;
-      const char *scale_env;
-      double scale;
 
       screen_wayland->xft_settings.dpi = xft_settings.dpi;
 
-      scale_env = g_getenv ("GDK_DPI_SCALE");
-      if (scale_env)
-        {
-          scale = g_ascii_strtod (scale_env, NULL);
-          if (scale != 0 && dpi > 0)
-            dpi *= scale;
-        }
-
       _gdk_screen_set_resolution (screen, dpi);
 
       notify_setting (screen, "gtk-xft-dpi");
diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c
index bb9e183..cd7e335 100644
--- a/gdk/x11/xsettings-client.c
+++ b/gdk/x11/xsettings-client.c
@@ -476,8 +476,6 @@ read_settings (GdkX11Screen *x11_screen,
        */
       int dpi_int = 0;
       double dpi;
-      const char *scale_env;
-      double scale;
 
       if (gdk_display_get_setting (display, "gtk-xft-dpi", &value))
         dpi_int = g_value_get_int (&value);
@@ -487,14 +485,6 @@ read_settings (GdkX11Screen *x11_screen,
       else
         dpi = -1.;
 
-      scale_env = g_getenv ("GDK_DPI_SCALE");
-      if (scale_env)
-        {
-          scale = g_ascii_strtod (scale_env, NULL);
-          if (scale != 0 && dpi > 0)
-            dpi *= scale;
-        }
-
       _gdk_screen_set_resolution (screen, dpi);
     }
 
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 958560d..a583d84 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -2258,8 +2258,6 @@ settings_update_resolution (GtkSettings *settings)
   GtkSettingsPrivate *priv = settings->priv;
   gint dpi_int;
   gdouble dpi;
-  const char *scale_env;
-  double scale;
 
   /* We handle this here in the case that the dpi was set on the GtkSettings
    * object by the application. Other cases are handled in
@@ -2276,14 +2274,6 @@ settings_update_resolution (GtkSettings *settings)
       else
         dpi = -1.;
 
-      scale_env = g_getenv ("GDK_DPI_SCALE");
-      if (scale_env)
-        {
-          scale = g_ascii_strtod (scale_env, NULL);
-          if (scale != 0 && dpi > 0)
-            dpi *= scale;
-        }
-
       gdk_screen_set_resolution (gdk_display_get_default_screen (priv->display), dpi);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]