mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
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
This commit is contained in:
parent
675d429ba0
commit
e977d65244
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user