Compare commits

...

1 Commits

Author SHA1 Message Date
Florian Müllner
e977d65244 monitor: Allow %NULL mode in calculate_mode_scale()
If no global scaling factor has been set, we currently segfault when
called with a %NULL mode parameter, which happens when calculating the
scale for the current mode while no modes are available.

Adding %NULL checks in the corresponding callers would mean that we'd
have to duplicate the global scaling factor handling, so instead consider
%NULL mode parameters valid and handle them gracefully.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/41
2018-03-09 16:20:58 +01:00

View File

@@ -1458,6 +1458,9 @@ calculate_scale (MetaMonitor *monitor,
scale = 1.0;
if (monitor_mode == NULL)
goto out;
meta_monitor_mode_get_resolution (monitor_mode,
&resolution_width,
&resolution_height);