diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 077a876436..665e01f78d 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -4059,6 +4059,16 @@ gdk_window_clear_area_internal (GdkWindow *window, g_return_if_fail (GDK_IS_WINDOW (window)); + if (GDK_WINDOW_DESTROYED (window)) + return; + + if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_FOREIGN) + { + GDK_WINDOW_IMPL_GET_IFACE (private->impl)->clear_area + (window, x, y, width, height, send_expose); + return; + } + /* This is what XClearArea does, and e.g. GtkCList uses it, so we need to duplicate that */ if (width == 0) diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h index 5905de80f3..d12a872c5d 100644 --- a/gdk/gdkwindowimpl.h +++ b/gdk/gdkwindowimpl.h @@ -71,6 +71,12 @@ struct _GdkWindowImplIface GdkWindow *new_parent, gint x, gint y); + void (* clear_area) (GdkWindow *window, + gint x, + gint y, + gint width, + gint height, + gboolean send_expose); void (* set_cursor) (GdkWindow *window, GdkCursor *cursor); diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 9caa17a163..cd5a3778f6 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -1660,6 +1660,19 @@ gdk_window_x11_reparent (GdkWindow *window, return FALSE; } +static void +gdk_window_x11_clear_area (GdkWindow *window, + gint x, + gint y, + gint width, + gint height, + gboolean send_expose) +{ + XClearArea (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window), + x, y, width, height, + send_expose); +} + static void gdk_window_x11_raise (GdkWindow *window) { @@ -5556,6 +5569,7 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface) iface->set_background = gdk_window_x11_set_background; iface->set_back_pixmap = gdk_window_x11_set_back_pixmap; iface->reparent = gdk_window_x11_reparent; + iface->clear_area = gdk_window_x11_clear_area; iface->set_cursor = gdk_window_x11_set_cursor; iface->get_geometry = gdk_window_x11_get_geometry; iface->get_root_coords = gdk_window_x11_get_root_coords;