Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Singer2020-07-24 09:54:11 -0400
committerLakshmi Shanmugam2020-07-28 02:02:29 -0400
commit5284661f3c0b3bade28ab33fbe4b6f6af8bdd9ef (patch)
tree1560d339c85e326aee414be6dc2fc01a7d88930e
parent7636e2f03eb5919569e16fe3839427b183170787 (diff)
downloadeclipse.platform.swt-5284661f3c0b3bade28ab33fbe4b6f6af8bdd9ef.tar.gz
eclipse.platform.swt-5284661f3c0b3bade28ab33fbe4b6f6af8bdd9ef.tar.xz
eclipse.platform.swt-5284661f3c0b3bade28ab33fbe4b6f6af8bdd9ef.zip
Bug 565525 - [macOS] Table: after dragging a selected line, Cmd+click removes selection
Change-Id: Idd7e21149ee49fdf90ec09975d44bace1876896e Signed-off-by: Thomas Singer <ts-swt@syntevo.com>
-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