mirror of
https://github.com/ImageMagick/ImageMagick.git
synced 2026-06-12 15:37:14 +02:00
cancel interactive window selection with right button press
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user