shell-global: Only set the scale factor if get_setting succeeded
If gdk_screen_get_setting fails, like if it's running without XSettings, then the GValue will have a value of 0. A lot of code tries to divide by the scale factor. This produces NaN, and combined with the fact that NaN is "leaky", we very quickly end up spinning out of control.
This commit is contained in:
parent
a745c1fe32
commit
a3d9946803
@ -749,7 +749,7 @@ update_scale_factor (GdkScreen *screen, gpointer data)
|
||||
GValue value = G_VALUE_INIT;
|
||||
|
||||
g_value_init (&value, G_TYPE_INT);
|
||||
gdk_screen_get_setting (global->gdk_screen, "gdk-window-scaling-factor", &value);
|
||||
if (gdk_screen_get_setting (global->gdk_screen, "gdk-window-scaling-factor", &value))
|
||||
g_object_set (context, "scale-factor", g_value_get_int (&value), NULL);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user