Implement gdk_window_clear_area natively for foreign windows

This fixes a redraw issue with the notification area in xfce4.
This commit is contained in:
Alexander Larsson 2009-06-26 15:45:53 +02:00
parent 4e902cd223
commit 0e548579de
3 changed files with 30 additions and 0 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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;