From 1289d0c3dd964a501ea0b039c0ce9bc39ec47caa Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 4 Jun 2022 15:41:39 +0800 Subject: [PATCH] Fix splurious drag-mouse-1 events after NS drag-and-drop * src/nsterm.m ([EmacsWindow beginDrag:...]): Clear dpyinfo->grabbed. --- src/nsterm.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nsterm.m b/src/nsterm.m index ecaca5b87fa..04475bbba05 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -9662,7 +9662,6 @@ nswindow_orderedIndex_sort (id w1, id w2, void *c) NSInteger window_number; NSWindow *w; #endif - drag_op = op; selected_op = NSDragOperationNone; image = [[NSImage alloc] initWithSize: NSMakeSize (1.0, 1.0)]; @@ -9716,6 +9715,11 @@ nswindow_orderedIndex_sort (id w1, id w2, void *c) #endif unblock_input (); + /* Assume all buttons have been released since the drag-and-drop + operation is now over. */ + if (!dnd_return_frame) + x_display_list->grabbed = 0; + [image release]; *frame_return = dnd_return_frame; -- 2.39.2