XGetGeometry(dpy, drawable, &root, &x, &y, &width, &height, &bd, &depth);
- glViewport(0, 0, width, height);
- glScissor(0, 0, width, height);
+ apple_glapi_oglfw_viewport_scissor(0, 0, width, height);
}
static bool
if (d) {
d->types.surface.pending_destroy = true;
d->release(d);
+
/*
* We release 2 references to the surface. One was acquired by
* the find, and the other was leftover from a context, or
* to actually destroy it when the pending_destroy is processed
* by a glViewport callback (see apple_glx_context_update()).
*/
- d->destroy(d);
-
- d->unlock(d);
+ if (!d->destroy(d)) {
+ /* apple_glx_drawable_find_by_uid returns a locked drawable */
+ d->unlock(d);
+ }
}
}