Merge branch 'fix-opaque-surface-crash' into 'main'

Avoid a crash in gdk_surface_is_opaque

Closes #6938

See merge request GNOME/gtk!7621
This commit is contained in:
Benjamin Otte 2024-08-17 11:26:27 +00:00
commit 62f5db06a1

View File

@ -2762,7 +2762,8 @@ gdk_surface_is_opaque (GdkSurface *self)
if (gdk_rectangle_contains (&priv->opaque_rect, &whole))
return TRUE;
if (cairo_region_contains_rectangle (priv->opaque_region, &whole) == CAIRO_REGION_OVERLAP_IN)
if (priv->opaque_region &&
cairo_region_contains_rectangle (priv->opaque_region, &whole) == CAIRO_REGION_OVERLAP_IN)
return TRUE;
return FALSE;