From ea2a2db8a224a77ee5e4aeb84c966b8be78bdfbe Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 2 Aug 2024 18:26:05 -0400 Subject: [PATCH] cancel interactive window selection with right button press --- MagickCore/xwindow.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); }