Avoid a crash in gdk_surface_is_opaque

Nothing in gtk calls gdk_surface_set_opaque_region anymore, so
the opaque region will normally be NULL.

Fixes: #6938
This commit is contained in:
Matthias Clasen
2024-08-17 07:02:31 -04:00
parent c3c1819e12
commit e32a12f877

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;