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.
This commit is contained in:
Matthias Clasen 2017-10-31 18:26:21 -04:00
parent b36b7f08fb
commit a27bfaa0a3
4 changed files with 0 additions and 43 deletions

View File

@ -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>

View File

@ -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");

View File

@ -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);
}

View File

@ -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);
}
}