summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSilenio Quarti2012-11-28 11:05:23 (EST)
committer Bogdan Gheorghe2013-01-15 16:15:01 (EST)
commit4141d0f2c2ec0fb8720bc145412b69e44102cc1b (patch)
treee1a695d2c3274719211fdb9a243bcafa428112e9
parentf5bb561e72c6b498fa2f13f95575b60b1c727038 (diff)
downloadeclipse.platform.swt-4141d0f2c2ec0fb8720bc145412b69e44102cc1b.zip
eclipse.platform.swt-4141d0f2c2ec0fb8720bc145412b69e44102cc1b.tar.gz
eclipse.platform.swt-4141d0f2c2ec0fb8720bc145412b69e44102cc1b.tar.bz2
Bug 388402 - List gets into bad state when an item is removed from context menu trigger
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java23
1 files 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 150b67c..4be4ff7 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);