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 e6b7846..f9445af 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.36.2.10 2004/08/05 08:57:50 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.11 2004/12/02 02:07:42 hobbs Exp $ */ #include "tkInt.h" @@ -2771,14 +2771,22 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width, (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; } @@ -2793,6 +2801,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 |