forked from AuroraMiddleware/gtk
x11: Don't follow dpi and scale from xsettings when GDK_SCALE set
If things are hardcoded in the environment, that wins.
This commit is contained in:
parent
4b9c08f48d
commit
867ba1df27
@ -1074,6 +1074,7 @@ _gdk_x11_screen_new (GdkDisplay *display,
|
|||||||
#endif
|
#endif
|
||||||
if (scale_str)
|
if (scale_str)
|
||||||
{
|
{
|
||||||
|
x11_screen->fixed_window_scale = TRUE;
|
||||||
x11_screen->window_scale = atol (scale_str);
|
x11_screen->window_scale = atol (scale_str);
|
||||||
if (x11_screen->window_scale == 0)
|
if (x11_screen->window_scale == 0)
|
||||||
x11_screen->window_scale = 1;
|
x11_screen->window_scale = 1;
|
||||||
|
@ -48,6 +48,7 @@ struct _GdkX11Screen
|
|||||||
gint primary_monitor;
|
gint primary_monitor;
|
||||||
|
|
||||||
gint window_scale;
|
gint window_scale;
|
||||||
|
gboolean fixed_window_scale;
|
||||||
|
|
||||||
/* Xft resources for the display, used for default values for
|
/* Xft resources for the display, used for default values for
|
||||||
* the Xft/ XSETTINGS
|
* the Xft/ XSETTINGS
|
||||||
|
@ -156,6 +156,7 @@ gdk_window_impl_x11_init (GdkWindowImplX11 *impl)
|
|||||||
{
|
{
|
||||||
impl->device_cursor = g_hash_table_new_full (NULL, NULL,
|
impl->device_cursor = g_hash_table_new_full (NULL, NULL,
|
||||||
NULL, g_object_unref);
|
NULL, g_object_unref);
|
||||||
|
impl->window_scale = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
GdkToplevelX11 *
|
GdkToplevelX11 *
|
||||||
|
@ -446,14 +446,17 @@ read_settings (GdkX11Screen *x11_screen,
|
|||||||
|
|
||||||
/* Since we support scaling we look at the specific Gdk/UnscaledDPI
|
/* Since we support scaling we look at the specific Gdk/UnscaledDPI
|
||||||
setting if it exists and use that instead of Xft/DPI if it is set */
|
setting if it exists and use that instead of Xft/DPI if it is set */
|
||||||
setting = g_hash_table_lookup (x11_screen->xsettings, "gdk-unscaled-dpi");
|
if (x11_screen->xsettings && !x11_screen->fixed_window_scale)
|
||||||
if (setting)
|
|
||||||
{
|
{
|
||||||
copy = g_new0 (GValue, 1);
|
setting = g_hash_table_lookup (x11_screen->xsettings, "gdk-unscaled-dpi");
|
||||||
g_value_init (copy, G_VALUE_TYPE (setting));
|
if (setting)
|
||||||
g_value_copy (setting, copy);
|
{
|
||||||
g_hash_table_insert (x11_screen->xsettings,
|
copy = g_new0 (GValue, 1);
|
||||||
"gtk-xft-dpi", copy);
|
g_value_init (copy, G_VALUE_TYPE (setting));
|
||||||
|
g_value_copy (setting, copy);
|
||||||
|
g_hash_table_insert (x11_screen->xsettings,
|
||||||
|
"gtk-xft-dpi", copy);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_notify)
|
if (do_notify)
|
||||||
@ -462,7 +465,8 @@ read_settings (GdkX11Screen *x11_screen,
|
|||||||
g_hash_table_unref (old_list);
|
g_hash_table_unref (old_list);
|
||||||
|
|
||||||
g_value_init (&value, G_TYPE_INT);
|
g_value_init (&value, G_TYPE_INT);
|
||||||
if (gdk_screen_get_setting (GDK_SCREEN (x11_screen),
|
if (!x11_screen->fixed_window_scale &&
|
||||||
|
gdk_screen_get_setting (GDK_SCREEN (x11_screen),
|
||||||
"gdk-window-scaling-factor", &value))
|
"gdk-window-scaling-factor", &value))
|
||||||
_gdk_x11_screen_set_window_scale (x11_screen,
|
_gdk_x11_screen_set_window_scale (x11_screen,
|
||||||
g_value_get_int (&value));
|
g_value_get_int (&value));
|
||||||
|
Loading…
Reference in New Issue
Block a user