From: Dana Jansens Date: Mon, 26 May 2003 21:17:14 +0000 (+0000) Subject: can draw!!@&@(c X-Git-Tag: gl2~105 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=7362c085576be9a3c4348511f83372bd87a36aee;p=dana%2Fopenbox.git can draw!!@&@(c --- diff --git a/render2/paint.c b/render2/paint.c index aa2b9527..d37290c8 100644 --- a/render2/paint.c +++ b/render2/paint.c @@ -50,7 +50,7 @@ void RrPaintArea(struct RrSurface *sur, int x, int y, int w, int h) switch (RrSurfaceType(sur)) { case RR_SURFACE_PLANAR: - RrPlanarPaint(sur, x, y, w, h); + RrPlanarPaint(sur, RrSurfaceX(sur) + x, RrSurfaceY(sur) + y, w, h); break; case RR_SURFACE_NONPLANAR: assert(0); diff --git a/render2/planar.h b/render2/planar.h index 907ff839..876601c7 100644 --- a/render2/planar.h +++ b/render2/planar.h @@ -12,7 +12,7 @@ struct RrPlanarSurface { #define RrPlanarColorType(sur) ((sur)->data.planar.colortype) #define RrPlanarPrimaryColor(sur) ((sur)->data.planar.primary) -#define RrPlanarSecondaryColor(sur) ((sur)->data.planar.primary) +#define RrPlanarSecondaryColor(sur) ((sur)->data.planar.secondary) void RrPlanarPaint(struct RrSurface *sur, int x, int y, int w, int h); diff --git a/render2/test.c b/render2/test.c index 59545c96..9eb060f5 100644 --- a/render2/test.c +++ b/render2/test.c @@ -24,7 +24,7 @@ int main() { Display *display; Window win; - XEvent report; + XEvent report, report2; XClassHint chint; Atom delete_win, protocols; int quit; @@ -78,9 +78,20 @@ int main() if ((Atom)report.xclient.data.l[0] == delete_win) quit = 1; case Expose: - RrPaint(sur); - break; + if (XCheckTypedWindowEvent(display, win, ConfigureNotify, + &report2)) { + XPutBackEvent(display, &report); + XPutBackEvent(display, &report2); + /* fall through ... */ + } else { + while (XCheckTypedWindowEvent(display, win, Expose, &report)); + RrPaintArea(sur, report.xexpose.x, report.xexpose.y, + report.xexpose.width, report.xexpose.height); + break; + } case ConfigureNotify: + while (XCheckTypedWindowEvent(display, win, ConfigureNotify, + &report)); RrSurfaceSetArea(sur, report.xconfigure.x, report.xconfigure.y,