Add support for composited child windows. (#412882, Ryan Lortie)

2007-06-01  Matthias Clasen  <mclasen@redhat.com>

        Add support for composited child windows.  (#412882, Ryan Lortie)

        * gdk/gdk.symbols:
        * gdk/gdkdisplay.h:
        * gdk/gdkinternals.h:
        * gdk/gdkwindow.[hc]: Add gdk_display_supports_composite() and
        gdk_window_set_composited().

        * gdk/x11/gdkevents-x11.c:
        * gdk/x11/gdkdisplay-x11.[hc]:
        * gdk/x11/gdkwindow-x11.[hc]: X11 implementation.

        * gdk/win32/gdkdisplay-win32.c:
        * gdk/win32/gdkwindow-win32.c: Dummy win32 implementration.

        * gdk/quartz/gdkdisplay-quartz.c:
        * gdk/quartz/gdkwindow-quartz.c: Dummy Quartz implementation.

        * gdk/directfb/gdkdisplay-directfb.c:
        * gdk/directfb/gdkwindow-directfb.c: Dummy DirectFB implementation.

        * tests/testgtk.c: Add a "composited window" test.


svn path=/trunk/; revision=18004
This commit is contained in:
Matthias Clasen
2007-06-01 12:16:12 +00:00
committed by Matthias Clasen
parent 62c13f0463
commit 885ba04648
21 changed files with 635 additions and 3 deletions

View File

@ -2101,6 +2101,34 @@ gdk_event_translate (GdkDisplay *display,
}
else
#endif
#if defined(HAVE_XCOMPOSITE) && defined (HAVE_XDAMAGE) && defined (HAVE_XFIXES)
if (display_x11->have_xdamage && window_private->composited &&
xevent->type == display_x11->xdamage_event_base + XDamageNotify)
{
XDamageNotifyEvent *damage_event = (XDamageNotifyEvent *) xevent;
XserverRegion repair;
GdkRectangle rect;
rect.x = window_private->x + damage_event->area.x;
rect.y = window_private->y + damage_event->area.y;
rect.width = damage_event->area.width;
rect.height = damage_event->area.height;
repair = XFixesCreateRegion (display_x11->xdisplay,
&damage_event->area, 1);
XDamageSubtract (display_x11->xdisplay,
window_impl->damage,
repair, None);
XFixesDestroyRegion (display_x11->xdisplay, repair);
if (window_private->parent != NULL)
_gdk_window_process_expose (GDK_WINDOW (window_private->parent),
damage_event->serial, &rect);
return_val = TRUE;
}
else
#endif
{
/* something else - (e.g., a Xinput event) */