blob: 070dae2d7562db0bd6263f1f743414518fd4c9a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
--- a/org/gudy/azureus2/ui/swt/mainwindow/SWTThread.java
+++ b/org/gudy/azureus2/ui/swt/mainwindow/SWTThread.java
@@ -229,57 +229,6 @@ public class SWTThread {
}
});
- if (Constants.isOSX) {
-
- // On Cocoa, we get a Close trigger on display. Need to check if all
- // platforms send this.
- display.addListener(SWT.Close, new Listener() {
- public void handleEvent(Event event) {
- event.doit = UIFunctionsManager.getUIFunctions().dispose(false, false);
- }
- });
-
- String platform = SWT.getPlatform();
- // use reflection here so we decouple generic SWT from OSX specific stuff to an extent
-
- if (platform.equals("carbon")) {
- try {
-
- Class<?> ehancerClass = Class.forName("org.gudy.azureus2.ui.swt.osx.CarbonUIEnhancer");
-
- Constructor<?> constructor = ehancerClass.getConstructor(new Class[] {});
-
- constructor.newInstance(new Object[] {});
-
- } catch (Throwable e) {
-
- Debug.printStackTrace(e);
- }
- } else if (platform.equals("cocoa")) {
- try {
-
- Class<?> ehancerClass = Class.forName("org.gudy.azureus2.ui.swt.osx.CocoaUIEnhancer");
-
- Method mGetInstance = ehancerClass.getMethod("getInstance", new Class[0]);
- Object claObj = mGetInstance.invoke(null, new Object[0] );
-
- Method mHookAppMenu = claObj.getClass().getMethod("hookApplicationMenu", new Class[] {});
- if (mHookAppMenu != null) {
- mHookAppMenu.invoke(claObj, new Object[0]);
- }
-
- Method mHookDocOpen = claObj.getClass().getMethod("hookDocumentOpen", new Class[] {});
- if (mHookDocOpen != null) {
- mHookDocOpen.invoke(claObj, new Object[0]);
- }
-
- } catch (Throwable e) {
-
- Debug.printStackTrace(e);
- }
- }
- }
-
if (app != null) {
app.runInSWTThread();
runner = new Thread(new AERunnable() {
|