1.0f, 0.0f
};
+int x_error_handler(Display *display, XErrorEvent *event)
+{
+ printf("Ignoring X error %d on resource %lx\n", event->error_code, event->resourceid);
+ (void)display;
+ return 0;
+}
+
int with_error(const char *message)
{
fprintf(stderr, "%s\n", message);
if(w==screen->root || w==screen->overlay)
return;
- XGetWindowAttributes(compositor->display, w, &win_attr);
+ if(!XGetWindowAttributes(compositor->display, w, &win_attr))
+ {
+ printf("XGetWindowAttributes failed; probably the window was already destroyed\n");
+ return;
+ }
if(win_attr.class==InputOnly)
return;
if(!compositor->display)
return with_error("Could not open X display");
+ XSetErrorHandler(&x_error_handler);
+
if(!XCompositeQueryExtension(compositor->display, &event_base, &error_base))
return with_error("XComposite is required but was not found");
else if(!XCompositeQueryVersion(compositor->display, &major_ver, &minor_ver))