diff options
author | Benjamin Otte <otte@redhat.com> | 2023-05-13 18:35:02 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2023-05-16 18:53:09 +0200 |
commit | b530ade8c6eb6673f8ccd543616c89b609b747d8 (patch) | |
tree | 6752bc3c6fe7904de9564804e48047af187a9106 | |
parent | 4a1598dc2a316eb27046467a33c68ff1babb55fa (diff) | |
download | gtk+-b530ade8c6eb6673f8ccd543616c89b609b747d8.tar.gz |
gdk: Clamp frame region to surface size
The region may be larger than the surface's size, but many rendering
APIs require the size to be clamped.
Fixes #5812
-rw-r--r-- | gdk/gdkdrawcontext.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdk/gdkdrawcontext.c b/gdk/gdkdrawcontext.c index 8699807cab..e461ebdd28 100644 --- a/gdk/gdkdrawcontext.c +++ b/gdk/gdkdrawcontext.c @@ -371,6 +371,12 @@ gdk_draw_context_begin_frame_full (GdkDrawContext *context, priv->surface->paint_context = g_object_ref (context); GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, prefers_high_depth, priv->frame_region); + + cairo_region_intersect_rectangle (priv->frame_region, + &(cairo_rectangle_int_t) { + 0, 0, + priv->surface->width, priv->surface->height + }); } #ifdef HAVE_SYSPROF |