From 4141d0f2c2ec0fb8720bc145412b69e44102cc1b Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Wed, 28 Nov 2012 11:05:23 -0500 Subject: Bug 388402 - List gets into bad state when an item is removed from context menu trigger --- .../cocoa/org/eclipse/swt/widgets/List.java | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java index 150b67c135..4be4ff74c9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java @@ -1104,14 +1104,21 @@ boolean sendKeyEvent (NSEvent nsEvent, int type) { } boolean sendMouseEvent (NSEvent nsEvent, int type, boolean send) { - if (type == SWT.MouseDown) { - mouseIsDown = true; - } else if (type == SWT.MouseUp || type == SWT.DragDetect) { - mouseIsDown = false; - - if (rowsChanged) { - rowsChanged = false; - ((NSTableView)view).noteNumberOfRowsChanged(); + boolean handleMouseDown = true; + if (nsEvent != null) { + int /*long*/ nsType = nsEvent.type(); + handleMouseDown = nsType == OS.NSLeftMouseDown || nsType == OS.NSLeftMouseUp; + } + if (handleMouseDown) { + if (type == SWT.MouseDown) { + mouseIsDown = true; + } else if (type == SWT.MouseUp || type == SWT.DragDetect) { + mouseIsDown = false; + + if (rowsChanged) { + rowsChanged = false; + ((NSTableView)view).noteNumberOfRowsChanged(); + } } } return super.sendMouseEvent(nsEvent, type, send); -- cgit v1.2.3