gdkwindow: Make the precondition of gdk_window_add_damage clearer

This commit is contained in:
Jasper St. Pierre 2014-06-23 12:29:55 -04:00
parent 06cfaea553
commit 8eb092ea14

View File

@ -3223,11 +3223,16 @@ gdk_window_add_damage (GdkWindow *toplevel,
{
GdkDisplay *display;
GdkEvent event = { 0, };
/* This function only makes sense for offscreen windows. */
g_assert (gdk_window_is_offscreen (toplevel));
event.expose.type = GDK_DAMAGE;
event.expose.window = toplevel;
event.expose.send_event = FALSE;
event.expose.region = damaged_region;
cairo_region_get_extents (event.expose.region, &event.expose.area);
display = gdk_window_get_display (event.expose.window);
_gdk_event_queue_append (display, gdk_event_copy (&event));
}