static ObCompositeFBConfig pixmap_config[MAX_DEPTH + 1]; /* depth is index */
static guint composite_idle_source = 0;
static gboolean need_redraw = FALSE;
+static gboolean animating = FALSE;
static Window composite_support_win = None;
#ifdef DEBUG
static gboolean composite_started = FALSE;
out->tf = rgba ? GLX_TEXTURE_FORMAT_RGBA_EXT : GLX_TEXTURE_FORMAT_RGB_EXT;
}
+void composite_dirty(void)
+{
+ need_redraw = 1;
+}
+
static gboolean composite_annex(void)
{
gchar *astr;
struct timeval start, end, dif;
GList *it;
ObWindow *win;
- ObClient *client = NULL;
+ ObClient *client;
if (!composite_enabled()) return FALSE;
-/* if (!need_redraw) return FALSE; */
+ if (!animating && !need_redraw)
+ return animating;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
client = WINDOW_AS_CLIENT(win);
if (!client->frame->visible)
continue;
- }
+ } else client = NULL;
d = window_depth(win);
}
#endif
- need_redraw = 0;
- return TRUE;
+ need_redraw = FALSE;
+ return animating;
}
static void composite_window_redir(ObWindow *w)
#endif
obt_display_ignore_errors(TRUE);
- w->damage = XDamageCreate(obt_display, window_top(w),
- XDamageReportNonEmpty);
+ w->damage = XDamageCreate(obt_display, window_redir(w),
+ XDamageReportRawRectangles);
obt_display_ignore_errors(FALSE);
glGenTextures(1, &w->texture);
void composite_window_setup (ObWindow *w) {}
void composite_window_cleanup (ObWindow *w) {}
void composite_window_invalid (ObWindow *w) {}
+void composite_dirty (void) {}
void composite_enable(void)
{
{
window = None;
} else
+#endif
+#ifdef USE_COMPOSITING
+ if (e->type == obt_display_extension_damage_basep + XDamageNotify)
+ {
+ XDamageNotifyEvent *d = (XDamageNotifyEvent *)e;
+ window = d->drawable;
+ } else
#endif
window = e->xany.window;
}
switch (e->type) {
case ConfigureNotify:
+ composite_dirty();
if (e->xconfigure.send_event) break;
if (e->xconfigure.window == window_redir(wi)) {
break;
case MapNotify:
+ composite_dirty();
if (e->xmap.window == window_redir(wi)) {
wi->mapped = TRUE;
pixchange = TRUE;
}
break;
case UnmapNotify:
+ composite_dirty();
if (e->xunmap.window == window_top(wi)) {
wi->mapped = FALSE;
used = TRUE;
}
break;
default:
-#ifdef SHAPE
#ifdef USE_COMPOSITING
+#ifdef SHAPE
if (obt_display_extension_shape &&
e->type == obt_display_extension_shape_basep + ShapeNotify)
{
XShapeEvent *s = (XShapeEvent*)e;
+ composite_dirty();
if (s->window == window_redir(wi) && s->kind == ShapeBounding) {
window_adjust_redir_shape(wi);
used = FALSE; /* let other people get this event also */
}
}
#endif
+ if (obt_display_extension_damage &&
+ e->type == obt_display_extension_damage_basep + XDamageNotify)
+ {
+ XDamageNotifyEvent *ev = (XDamageNotifyEvent *)e;
+ composite_dirty();
+ used = TRUE;
+ }
#endif
}
if (pixchange)