diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index a474b6ab81..102b77817b 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -5064,10 +5064,7 @@ MagickExport Image *XImportImage(const ImageInfo *image_info, image=XGetWindowImage(display,target,ximage_info->borders, ximage_info->descend ? 1U : 0U,exception); (void) XUngrabServer(display); - if (image == (Image *) NULL) - ThrowXWindowException(XServerError,"UnableToReadXWindowImage", - image_info->filename) - else + if (image != (Image *) NULL) { (void) CopyMagickString(image->filename,image_info->filename, MagickPathExtent); @@ -9340,7 +9337,7 @@ static Window XSelectWindow(Display *display,RectangleInfo *crop_info) annotate_context=XCreateGC(display,root_window,(size_t) (GCBackground | GCForeground | GCFunction | GCSubwindowMode),&context_values); if (annotate_context == (GC) NULL) - return(MagickFalse); + return((Window) NULL); /* Grab the pointer using target cursor. */ @@ -9443,6 +9440,8 @@ static Window XSelectWindow(Display *display,RectangleInfo *crop_info) } if ((crop_info->width != 0) && (crop_info->height != 0)) target_window=root_window; + if (event.xbutton.button == Button3) + target_window=(Window) NULL; return(target_window); }