From 1e560d6adbad717557bd28a3de8a7b16abd12986 Mon Sep 17 00:00:00 2001 From: David Reveman Date: Thu, 6 Nov 2008 13:52:02 -0500 Subject: [PATCH] Never enter dmxDispatch through dmxGetImage as it might be called when sending a client reply. --- hw/dmx/dmxgcops.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c index 18da865e5..df86f5862 100644 --- a/hw/dmx/dmxgcops.c +++ b/hw/dmx/dmxgcops.c @@ -589,10 +589,9 @@ static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw) void dmxGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planeMask, char *pdstLine) { - DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum]; - Drawable draw; - xcb_get_image_cookie_t cookie; - xcb_get_image_reply_t *reply; + DMXScreenInfo *dmxScreen = &dmxScreens[pDrawable->pScreen->myNum]; + Drawable draw; + xcb_get_image_reply_t *reply; /* Cannot get image from unviewable window */ if (pDrawable->type == DRAWABLE_WINDOW) { @@ -619,22 +618,13 @@ void dmxGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, } } - cookie = xcb_get_image (dmxScreen->connection, - format, - draw, - sx, sy, w, h, - planeMask); - - do { - dmxDispatch (); - - if (xcb_poll_for_reply (dmxScreen->connection, - cookie.sequence, - (void **) &reply, - NULL)) - break; - } while (dmxWaitForResponse () && dmxScreen->alive); - + reply = xcb_get_image_reply (dmxScreen->connection, + xcb_get_image (dmxScreen->connection, + format, + draw, + sx, sy, w, h, + planeMask), + NULL); if (reply) { const xcb_setup_t *setup = xcb_get_setup (dmxScreen->connection);