monitor: Only assign suggested positions to valid pointers

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>
This commit is contained in:
Marco Trevisan (Treviño) 2019-03-27 05:08:39 +01:00 committed by Marge Bot
parent ab48b6b933
commit 32d7c5fbfb

View File

@ -730,8 +730,11 @@ meta_monitor_normal_get_suggested_position (MetaMonitor *monitor,
if (output_info->suggested_x < 0 && output_info->suggested_y < 0) if (output_info->suggested_x < 0 && output_info->suggested_y < 0)
return FALSE; return FALSE;
*x = output_info->suggested_x; if (x)
*y = output_info->suggested_y; *x = output_info->suggested_x;
if (y)
*y = output_info->suggested_y;
return TRUE; return TRUE;
} }