GDK_EXPOSE



I think there might be a bug in how GDK_EXPOSE events are generated.

In X11, an expose event is sent if some portion of a window was exposed as
in need of redraw by a client.

An X11 GraphicsExpose event is very different. This will occur when the
CopyArea or CopyPlane X protocol has been performed and the destination of
the CopyArea or CopyPlane could not be drawn completely because some 
portion of the source was obscured or unmapped, making the bits
unavailable.

Here's the code in Gdk that takes the raw X event and synthesizes the 
GDK_EXPOSE events. Notice that the only diffs are the GDK_NOTE and that
the event structure fields come from different places.

    case Expose:
      /* Print debugging info.
       */
      GDK_NOTE (EVENTS,
                g_message ("expose:\t\twindow: %ld  %d  x,y: %d %d  w,h: %d %d",
                           xevent->xexpose.window, xevent->xexpose.count,
                           xevent->xexpose.x, xevent->xexpose.y,
                           xevent->xexpose.width, xevent->xexpose.height));
      gdk_compress_exposures (xevent, window);

      event->expose.type = GDK_EXPOSE;
      event->expose.window = window;
      event->expose.area.x = xevent->xexpose.x;
      event->expose.area.y = xevent->xexpose.y;
      event->expose.area.width = xevent->xexpose.width;
      event->expose.area.height = xevent->xexpose.height;
      event->expose.count = xevent->xexpose.count;

      break;

    case GraphicsExpose:
      /* Print debugging info.
       */
      GDK_NOTE (EVENTS,
                g_message ("graphics expose:\tdrawable: %ld",
                           xevent->xgraphicsexpose.drawable));

      event->expose.type = GDK_EXPOSE;
      event->expose.window = window;
      event->expose.area.x = xevent->xgraphicsexpose.x;
      event->expose.area.y = xevent->xgraphicsexpose.y;
      event->expose.area.width = xevent->xgraphicsexpose.width;
      event->expose.area.height = xevent->xgraphicsexpose.height;
      event->expose.count = xevent->xexpose.count;

      break;

Seems I'd be hard pressed to know if my GDK_EXPOSE event was caused by a
failed CopyArea or an expose event. Perhaps there is need for a
GDK_GRAPHICS_EXPOSE event... 

Regards,

syd

-- 
Syd Logan

slogan@cts.com
http://www.users.cts.com/crash/s/slogan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]