Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java36
1 files changed, 20 insertions, 16 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
index bc3c194ac5..0f55eb43cd 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java
@@ -3604,24 +3604,28 @@ boolean sendMouseEvent(NSEvent nsEvent, int type, boolean send) {
* To keep the order of events correct, deselect the other selected items and send the
* selection event before MouseUp is sent. Ignore the next selection event.
*/
- if (!dragDetected && selectedRowIndex != -1) {
- NSTableView widget = (NSTableView)view;
- NSIndexSet selectedRows = widget.selectedRowIndexes ();
- int count = (int)selectedRows.count();
- long [] indexBuffer = new long [count];
- selectedRows.getIndexes(indexBuffer, count, 0);
- for (int i = 0; i < count; i++) {
- if (indexBuffer[i] == selectedRowIndex) continue;
+ if (selectedRowIndex != -1) {
+ if (dragDetected) {
+ selectedRowIndex = -1;
+ } else {
+ NSTableView widget = (NSTableView)view;
+ NSIndexSet selectedRows = widget.selectedRowIndexes ();
+ int count = (int)selectedRows.count();
+ long [] indexBuffer = new long [count];
+ selectedRows.getIndexes(indexBuffer, count, 0);
+ for (int i = 0; i < count; i++) {
+ if (indexBuffer[i] == selectedRowIndex) continue;
+ ignoreSelect = true;
+ widget.deselectRow (indexBuffer[i]);
+ ignoreSelect = false;
+ }
+
+ Event event = new Event ();
+ event.item = _getItem ((int)selectedRowIndex);
+ selectedRowIndex = -1;
+ sendSelectionEvent (SWT.Selection, event, false);
ignoreSelect = true;
- widget.deselectRow (indexBuffer[i]);
- ignoreSelect = false;
}
-
- Event event = new Event ();
- event.item = _getItem ((int)selectedRowIndex);
- selectedRowIndex = -1;
- sendSelectionEvent (SWT.Selection, event, false);
- ignoreSelect = true;
}
dragDetected = false;
}

Back to the top