/* we don't use exposes but the render lib wants them all! */
if (ob_state != State_Exiting && e.type == Expose)
- RrExpose(ob_render_inst, &e);
+ RrExpose(ob_render_inst, &e.xexpose);
#ifdef USE_LIBSN
sn_display_process_event(ob_sn_display, &e);
a->y = MIN(a->y, y)
-void RrExpose(struct RrInstance *inst, XEvent *e)
+void RrExpose(struct RrInstance *inst, XExposeEvent *e)
{
XEvent e2;
- GSList *tops = NULL, *it, *n;
struct RrSurface *sur;
+ Window win;
- e2 = *e;
- if ((sur = RrInstaceLookupSurface(inst, e2.xexpose.window))) {
- while (XCheckTypedWindowEvent(RrDisplay(inst), Expose,
- e->xexpose.window, &e2));
- while (sur->parent &&
- RrSurfaceType(sur->parent) != RR_SURFACE_NONE) {
+ win = e->window;
+
+ if ((sur = RrInstaceLookupSurface(inst, win))) {
+ while (XCheckTypedWindowEvent(RrDisplay(inst), Expose, win, &e2));
+ while (sur->parent && RrSurfaceType(sur->parent) != RR_SURFACE_NONE)
sur = sur->parent;
- }
RrPaint(sur);
- } else {
- RrDebug("Unable to find surface for window 0x%lx\n",
- e2.xexpose.window);
- }
+ } else
+ RrDebug("Unable to find surface for window 0x%lx\n", win);
}
/*! Paints the surface, and all its children */
void RrPaint(struct RrSurface *sur)
-{
- RrPaintArea(sur, 0, 0, RrSurfaceWidth(sur), RrSurfaceHeight(sur));
-}
-
-/*! Paints the surface, and all its children, but only in the given area. */
-void RrPaintArea(struct RrSurface *sur, int x, int y, int w, int h)
{
struct RrInstance *inst;
struct RrSurface *p;
switch (RrSurfaceType(sur)) {
case RR_SURFACE_PLANAR:
- RrPlanarPaint(sur, surx + x, sury + y, w, h);
+ RrPlanarPaint(sur, surx, sury);
break;
case RR_SURFACE_NONPLANAR:
assert(0);
}
}
-void RrPlanarPaint(struct RrSurface *sur, int x, int y, int w, int h)
+void RrPlanarPaint(struct RrSurface *sur, int absx, int absy)
{
struct RrColor *pri, *sec, avg;
int x, y, w, h;
#define RrPlanarPrimaryColor(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);
+void RrPlanarPaint(struct RrSurface *sur, int absx, int absy);
void RrPlanarMinSize(struct RrSurface *sur, int *w, int *h);
int y,
int w,
int h);
+void RrSurfaceSetPos(struct RrSurface *sur,
+ int x,
+ int y);
+void RrSurfaceSetSize(struct RrSurface *sur,
+ int w,
+ int h);
Window RrSurfaceWindow(struct RrSurface *sur);
/*! Paints the surface, and all its children */
void RrPaint(struct RrSurface *sur);
-/*! Paints the surface, and all its children, but only in the given area. */
-void RrPaintArea(struct RrSurface *sur,
- int x,
- int y,
- int w,
- int h);
-void RrExpose(struct RrInstance *inst, XEvent *e);
+
+void RrExpose(struct RrInstance *inst, XExposeEvent *e);
#endif
}
}
+void RrSurfaceSetPos(struct RrSurface *sur,
+ int x,
+ int y)
+{
+ RrSurfaceSetArea(sur, x, y, sur->w, sur->h);
+}
+
+void RrSurfaceSetSize(struct RrSurface *sur,
+ int w,
+ int h)
+{
+ RrSurfaceSetArea(sur, sur->x, sur->y, w, h);
+}
+
void RrSurfaceSetArea(struct RrSurface *sur,
int x,
int y,
/* fall through ... */
} else {
while (XCheckTypedWindowEvent(display, win, Expose, &report));
- RrPaintArea(sur, report.xexpose.x, report.xexpose.y,
- report.xexpose.width, report.xexpose.height);
+ RrPaint(sur);
break;
}
case ConfigureNotify:
while (XCheckTypedWindowEvent(display, win, ConfigureNotify,
&report));
- RrSurfaceSetArea(sur,
- report.xconfigure.x,
- report.xconfigure.y,
+ RrSurfaceSetSize(sur,
report.xconfigure.width,
report.xconfigure.height);
break;