summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/List.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Table.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tree.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java4
6 files changed, 45 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
index 6678d079cb..e2622c6878 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Composite.java
@@ -127,6 +127,13 @@ Control [] _getTabList () {
return tabList;
}
+boolean acceptsFirstMouse (int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
+ if ((state & CANVAS) != 0) {
+ return true;
+ }
+ return super.acceptsFirstMouse (id, sel, theEvent);
+}
+
boolean acceptsFirstResponder (int /*long*/ id, int /*long*/ sel) {
if ((state & CANVAS) != 0) {
if ((style & SWT.NO_FOCUS) == 0 && hooksKeys ()) {
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 a6b1299851..9c606fd4d7 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
@@ -2603,6 +2603,8 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_expandItem_expandChildren_, proc4, "@:@Z");
OS.class_addMethod(cls, OS.sel_collapseItem_collapseChildren_, proc4, "@:@Z");
OS.class_addMethod(cls, OS.sel_drawBackgroundInClipRect_, drawBackgroundInClipRectProc, "@:{NSRect}");
+ OS.class_addMethod(cls, OS.sel_acceptsFirstResponder, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_needsPanelToBecomeKey, proc2, "@:");
addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc);
addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc);
OS.objc_registerClassPair(cls);
@@ -2782,6 +2784,8 @@ void initClasses () {
OS.class_addMethod(cls, OS.sel_deselectAll_, proc3, "@:@");
OS.class_addMethod(cls, OS.sel_tableView_writeRowsWithIndexes_toPasteboard_, proc5, "@:@@@");
OS.class_addMethod(cls, OS.sel_drawBackgroundInClipRect_, drawBackgroundInClipRectProc, "@:{NSRect}");
+ OS.class_addMethod(cls, OS.sel_acceptsFirstResponder, proc2, "@:");
+ OS.class_addMethod(cls, OS.sel_needsPanelToBecomeKey, proc2, "@:");
addEventMethods(cls, proc2, proc3, drawRectProc, hitTestProc, setNeedsDisplayInRectProc);
addAccessibilityMethods(cls, proc2, proc3, proc4, accessibilityHitTestProc);
OS.objc_registerClassPair(cls);
@@ -4989,7 +4993,7 @@ void applicationSendEvent (int /*long*/ id, int /*long*/ sel, int /*long*/ event
}
break;
}
- sendEvent = true;
+ if (type != OS.NSAppKitDefined) sendEvent = true;
/*
* Feature in Cocoa. The help key triggers context-sensitive help but doesn't get forwarded to the window as a key event.
@@ -5011,7 +5015,7 @@ void applicationSendEvent (int /*long*/ id, int /*long*/ sel, int /*long*/ event
super_struct.super_class = OS.objc_msgSend (id, OS.sel_superclass);
OS.objc_msgSendSuper (super_struct, sel, event);
}
- sendEvent = false;
+ if (type != OS.NSAppKitDefined) sendEvent = false;
}
void applicationWillFinishLaunching (int /*long*/ id, int /*long*/ sel, int /*long*/ notification) {
@@ -5371,6 +5375,8 @@ static int /*long*/ windowProc(int /*long*/ id, int /*long*/ sel) {
return widget.isFlipped(id, sel) ? 1 : 0;
} else if (sel == OS.sel_canBecomeKeyView) {
return widget.canBecomeKeyView(id,sel) ? 1 : 0;
+ } else if (sel == OS.sel_needsPanelToBecomeKey) {
+ return widget.needsPanelToBecomeKey(id,sel) ? 1 : 0;
} else if (sel == OS.sel_becomeKeyWindow) {
widget.becomeKeyWindow(id, sel);
} else if (sel == OS.sel_unmarkText) {
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 2fc57e3873..72cd7a9bd4 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
@@ -96,6 +96,10 @@ int /*long*/ accessibilityAttributeValue (int /*long*/ id, int /*long*/ sel, int
return super.accessibilityAttributeValue(id, sel, arg0);
}
+boolean acceptsFirstResponder (int /*long*/ id, int /*long*/ sel) {
+ return true;
+}
+
/**
* Adds the argument to the end of the receiver's list.
*
@@ -766,6 +770,10 @@ void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
didSelect = false;
}
+boolean needsPanelToBecomeKey (int /*long*/ id, int /*long*/ sel) {
+ return false;
+}
+
int /*long*/ numberOfRowsInTableView(int /*long*/ id, int /*long*/ sel, int /*long*/ aTableView) {
return itemCount;
}
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 2bc300acf5..bee0d9b369 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
@@ -126,6 +126,10 @@ public Table (Composite parent, int style) {
super (parent, checkStyle (style));
}
+boolean acceptsFirstResponder (int /*long*/ id, int /*long*/ sel) {
+ return true;
+}
+
int /*long*/ accessibilityAttributeValue(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) {
int /*long*/ returnValue = 0;
NSString attributeName = new NSString(arg0);
@@ -252,7 +256,7 @@ boolean canDragRowsWithIndexes_atPoint(int /*long*/ id, int /*long*/ sel, int /*
}
// The clicked row must be selected to initiate a drag.
- return (widget.isRowSelected(row) && drag);
+ return (widget.isRowSelected(row) && drag) || !hasFocus();
}
boolean checkData (TableItem item) {
@@ -2005,6 +2009,10 @@ void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
didSelect = false;
}
+boolean needsPanelToBecomeKey (int /*long*/ id, int /*long*/ sel) {
+ return false;
+}
+
/*
* Feature in Cocoa. If a checkbox is in multi-state mode, nextState cycles
* from off to mixed to on and back to off again. This will cause the on state
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 e379bf5a7c..f71d48025d 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
@@ -158,6 +158,10 @@ TreeItem _getItem (TreeItem parentItem, int index, boolean create) {
return item;
}
+boolean acceptsFirstResponder (int /*long*/ id, int /*long*/ sel) {
+ return true;
+}
+
int /*long*/ accessibilityAttributeValue(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) {
int /*long*/ returnValue = 0;
NSString attributeName = new NSString(arg0);
@@ -304,7 +308,7 @@ boolean canDragRowsWithIndexes_atPoint(int /*long*/ id, int /*long*/ sel, int /*
}
// The clicked row must be selected to initiate a drag.
- return (widget.isRowSelected(row) && drag);
+ return (widget.isRowSelected(row) && drag) || !hasFocus();
}
boolean checkData (TreeItem item) {
@@ -2054,6 +2058,10 @@ void mouseDownSuper(int /*long*/ id, int /*long*/ sel, int /*long*/ theEvent) {
didSelect = false;
}
+boolean needsPanelToBecomeKey (int /*long*/ id, int /*long*/ sel) {
+ return false;
+}
+
/*
* Feature in Cocoa. If a checkbox is in multi-state mode, nextState cycles
* from off to mixed to on and back to off again. This will cause the on state
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
index 0edfe16fff..1e5f964597 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Widget.java
@@ -260,6 +260,10 @@ boolean canBecomeKeyWindow (int /*long*/ id, int /*long*/ sel) {
return callSuperBoolean (id, sel);
}
+boolean needsPanelToBecomeKey (int /*long*/ id, int /*long*/ sel) {
+ return callSuperBoolean (id, sel);
+}
+
void cancelOperation(int /*long*/ id, int /*long*/ sel, int /*long*/ arg0) {
}