Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Brychcy2018-09-09 08:18:30 +0000
committerLakshmi Shanmugam2018-09-11 06:56:18 +0000
commit1c05ebb0a4b4d502a0d1bdf1d0faffade202ff40 (patch)
tree1ed73b75bcb45a149a7a43d2b3db730c01d04026
parent401e060250c12fde47411263f759a0cce59c8932 (diff)
downloadeclipse.platform.swt-1c05ebb0a4b4d502a0d1bdf1d0faffade202ff40.tar.gz
eclipse.platform.swt-1c05ebb0a4b4d502a0d1bdf1d0faffade202ff40.tar.xz
eclipse.platform.swt-1c05ebb0a4b4d502a0d1bdf1d0faffade202ff40.zip
Bug 538813 - [cocoa] re-fix "Two-finger tap to simulate right-click
results in multiple click events" Change-Id: Ia09505855662c96369df67b12071d540753bd082 Signed-off-by: Till Brychcy <register.eclipse@brychcy.de>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java1
5 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index 5f0d5105f8..d7a2cc25cc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -2493,6 +2493,8 @@ void markLayout (boolean changed, boolean all) {
@Override
long /*int*/ menuForEvent (long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
+ if (display.lastHandledMenuForEventId == theEvent) return 0;
+ display.lastHandledMenuForEventId = theEvent;
if (!isEnabled ()) return 0;
NSPoint pt = NSEvent.mouseLocation();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index 7a843c27b5..82b167898f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -160,6 +160,8 @@ public class Display extends Device {
Menu menuBar;
Menu[] menus, popups;
+ long lastHandledMenuForEventId;
+
/* Menu items with ESC key as accelerator need to be handled differently on Cocoa */
boolean escAsAcceleratorPresent = false;
@@ -1352,7 +1354,7 @@ public Rectangle getClientArea () {
checkDevice ();
NSArray screens = NSScreen.screens();
if (screens == null) return new Rectangle(0, 0, 0, 0);
-
+
if (screens.count() != 1) return getBounds (screens);
NSScreen screen = new NSScreen(screens.objectAtIndex(0));
NSRect frame = screen.frame();
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 ae5bf67cd8..0c1d0a302c 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
@@ -750,6 +750,7 @@ public boolean isSelected (int index) {
*/
@Override
long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
+ if (display.lastHandledMenuForEventId == theEvent) return 0;
NSEvent event = new NSEvent(theEvent);
NSTableView table = (NSTableView)view;
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 e871013d35..7592c64437 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
@@ -2026,6 +2026,7 @@ boolean isTrim (NSView view) {
@Override
long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
+ if (display.lastHandledMenuForEventId == theEvent) return 0;
if (id != headerView.id) {
/*
* Feature in Cocoa: Table views do not change the selection when the user
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
index ace26c4454..42fd2b7f25 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java
@@ -2073,6 +2073,7 @@ void keyDown(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
@Override
long /*int*/ menuForEvent(long /*int*/ id, long /*int*/ sel, long /*int*/ theEvent) {
+ if (display.lastHandledMenuForEventId == theEvent) return 0;
if (id != headerView.id) {
/*
* Feature in Cocoa: Table views do not change the selection when the user

Back to the top