mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
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:
parent
4e902cd223
commit
0e548579de
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user