diff options
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r-- | generic/tkImgPhoto.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 46ae9d4..76a07dd 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.51 2004/10/26 14:07:57 patthoyts Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.52 2004/12/02 02:10:37 hobbs Exp $ */ #include "tkInt.h" @@ -2784,14 +2784,22 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width, if ((instancePtr->masterPtr->flags & COMPLEX_ALPHA) && visInfo.depth >= 15 && (visInfo.class == DirectColor || visInfo.class == TrueColor)) { + Tk_ErrorHandler handler; XImage *bgImg = NULL; /* + * Create an error handler to suppress the case where the input was + * not properly constrained, which can cause an X error. [Bug 979239] + */ + handler = Tk_CreateErrorHandler(display, -1, -1, -1, + (Tk_ErrorProc *) NULL, (ClientData) NULL); + /* * Pull the current background from the display to blend with */ bgImg = XGetImage(display, drawable, drawableX, drawableY, (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap); if (bgImg == NULL) { + Tk_DeleteErrorHandler(handler); return; } @@ -2806,6 +2814,7 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width, bgImg, 0, 0, drawableX, drawableY, (unsigned int) width, (unsigned int) height); XDestroyImage(bgImg); + Tk_DeleteErrorHandler(handler); } else { /* * masterPtr->region describes which parts of the image contain |