]> granicus.if.org Git - imagemagick/commitdiff
Fix XSelectWindow function (#1563)
authorOmar Ahmad <25300994+OmarSquircleArt@users.noreply.github.com>
Mon, 29 Apr 2019 18:41:00 +0000 (20:41 +0200)
committerImageMagick <urban-warrior@users.noreply.github.com>
Mon, 29 Apr 2019 18:41:00 +0000 (14:41 -0400)
MagickCore/xwindow.c

index 2a188cb40ff02c706962aae1aaaa776f7f3d0474..3cbebc39d7c002beacc34965b23bb57a34d2f401 100644 (file)
@@ -9315,6 +9315,7 @@ static Window XSelectWindow(Display *display,RectangleInfo *crop_info)
   target_window=(Window) NULL;
   x_offset=0;
   y_offset=0;
+  (void) XGrabServer(display);
   do
   {
     if ((crop_info->width*crop_info->height) >= MinimumCropArea)
@@ -9383,6 +9384,7 @@ static Window XSelectWindow(Display *display,RectangleInfo *crop_info)
         break;
     }
   } while ((target_window == (Window) NULL) || (presses > 0));
+  (void) XUngrabServer(display);
   (void) XUngrabPointer(display,CurrentTime);
   (void) XFreeCursor(display,target_cursor);
   (void) XFreeGC(display,annotate_context);