author | dmarkov |
Thu, 01 Sep 2016 22:17:48 +0300 | |
changeset 40993 | a24dc7d0dd28 |
parent 40446 | cf666940a804 |
child 41787 | a7f3130da805 |
permissions | -rw-r--r-- |
12047 | 1 |
/* |
39511
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
2 |
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
12047 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
#import <Cocoa/Cocoa.h> |
|
27 |
#import <JavaNativeFoundation/JavaNativeFoundation.h> |
|
28 |
||
29 |
#import "sun_lwawt_macosx_CPlatformWindow.h" |
|
30 |
#import "com_apple_eawt_event_GestureHandler.h" |
|
31 |
#import "com_apple_eawt_FullScreenHandler.h" |
|
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
32 |
#import "ApplicationDelegate.h" |
12047 | 33 |
|
34 |
#import "AWTWindow.h" |
|
35 |
#import "AWTView.h" |
|
36 |
#import "GeomUtilities.h" |
|
37 |
#import "ThreadUtilities.h" |
|
38 |
||
39 |
#define MASK(KEY) \ |
|
40 |
(sun_lwawt_macosx_CPlatformWindow_ ## KEY) |
|
41 |
||
42 |
#define IS(BITS, KEY) \ |
|
43 |
((BITS & MASK(KEY)) != 0) |
|
44 |
||
45 |
#define SET(BITS, KEY, VALUE) \ |
|
46 |
BITS = VALUE ? BITS | MASK(KEY) : BITS & ~MASK(KEY) |
|
47 |
||
48 |
static JNF_CLASS_CACHE(jc_CPlatformWindow, "sun/lwawt/macosx/CPlatformWindow"); |
|
49 |
||
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
50 |
// Cocoa windowDidBecomeKey/windowDidResignKey notifications |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
51 |
// doesn't provide information about "opposite" window, so we |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
52 |
// have to do a bit of tracking. This variable points to a window |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
53 |
// which had been the key window just before a new key window |
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
54 |
// was set. It would be nil if the new key window isn't an AWT |
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
55 |
// window or the app currently has no key window. |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
56 |
static AWTWindow* lastKeyWindow = nil; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
57 |
|
39511
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
58 |
// This variable contains coordinates of a window's top left |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
59 |
// which was positioned via java.awt.Window.setLocationByPlatform. |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
60 |
// It would be NSZeroPoint if 'Location by Platform' is not used. |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
61 |
static NSPoint lastTopLeftPoint; |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
62 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
63 |
// -------------------------------------------------------------- |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
64 |
// NSWindow/NSPanel descendants implementation |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
65 |
#define AWT_NS_WINDOW_IMPLEMENTATION \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
66 |
- (id) initWithDelegate:(AWTWindow *)delegate \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
67 |
frameRect:(NSRect)contectRect \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
68 |
styleMask:(NSUInteger)styleMask \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
69 |
contentView:(NSView *)view \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
70 |
{ \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
71 |
self = [super initWithContentRect:contectRect \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
72 |
styleMask:styleMask \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
73 |
backing:NSBackingStoreBuffered \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
74 |
defer:NO]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
75 |
\ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
76 |
if (self == nil) return nil; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
77 |
\ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
78 |
[self setDelegate:delegate]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
79 |
[self setContentView:view]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
80 |
[self setInitialFirstResponder:view]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
81 |
[self setReleasedWhenClosed:NO]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
82 |
[self setPreservesContentDuringLiveResize:YES]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
83 |
\ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
84 |
return self; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
85 |
} \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
86 |
\ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
87 |
/* NSWindow overrides */ \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
88 |
- (BOOL) canBecomeKeyWindow { \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
89 |
return [(AWTWindow*)[self delegate] canBecomeKeyWindow]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
90 |
} \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
91 |
\ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
92 |
- (BOOL) canBecomeMainWindow { \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
93 |
return [(AWTWindow*)[self delegate] canBecomeMainWindow]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
94 |
} \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
95 |
\ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
96 |
- (BOOL) worksWhenModal { \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
97 |
return [(AWTWindow*)[self delegate] worksWhenModal]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
98 |
} \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
99 |
\ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
100 |
- (void)sendEvent:(NSEvent *)event { \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
101 |
[(AWTWindow*)[self delegate] sendEvent:event]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
102 |
[super sendEvent:event]; \ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
103 |
} |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
104 |
|
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
105 |
@implementation AWTWindow_Normal |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
106 |
AWT_NS_WINDOW_IMPLEMENTATION |
28227
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
107 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
108 |
// Gesture support |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
109 |
- (void)postGesture:(NSEvent *)event as:(jint)type a:(jdouble)a b:(jdouble)b { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
110 |
AWT_ASSERT_APPKIT_THREAD; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
111 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
112 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
113 |
jobject platformWindow = [((AWTWindow *)self.delegate).javaPlatformWindow jObjectWithEnv:env]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
114 |
if (platformWindow != NULL) { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
115 |
// extract the target AWT Window object out of the CPlatformWindow |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
116 |
static JNF_MEMBER_CACHE(jf_target, jc_CPlatformWindow, "target", "Ljava/awt/Window;"); |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
117 |
jobject awtWindow = JNFGetObjectField(env, platformWindow, jf_target); |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
118 |
if (awtWindow != NULL) { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
119 |
// translate the point into Java coordinates |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
120 |
NSPoint loc = [event locationInWindow]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
121 |
loc.y = [self frame].size.height - loc.y; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
122 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
123 |
// send up to the GestureHandler to recursively dispatch on the AWT event thread |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
124 |
static JNF_CLASS_CACHE(jc_GestureHandler, "com/apple/eawt/event/GestureHandler"); |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
125 |
static JNF_STATIC_MEMBER_CACHE(sjm_handleGestureFromNative, jc_GestureHandler, "handleGestureFromNative", "(Ljava/awt/Window;IDDDD)V"); |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
126 |
JNFCallStaticVoidMethod(env, sjm_handleGestureFromNative, awtWindow, type, (jdouble)loc.x, (jdouble)loc.y, (jdouble)a, (jdouble)b); |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
127 |
(*env)->DeleteLocalRef(env, awtWindow); |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
128 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
129 |
(*env)->DeleteLocalRef(env, platformWindow); |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
130 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
131 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
132 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
133 |
- (void)beginGestureWithEvent:(NSEvent *)event { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
134 |
[self postGesture:event |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
135 |
as:com_apple_eawt_event_GestureHandler_PHASE |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
136 |
a:-1.0 |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
137 |
b:0.0]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
138 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
139 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
140 |
- (void)endGestureWithEvent:(NSEvent *)event { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
141 |
[self postGesture:event |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
142 |
as:com_apple_eawt_event_GestureHandler_PHASE |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
143 |
a:1.0 |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
144 |
b:0.0]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
145 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
146 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
147 |
- (void)magnifyWithEvent:(NSEvent *)event { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
148 |
[self postGesture:event |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
149 |
as:com_apple_eawt_event_GestureHandler_MAGNIFY |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
150 |
a:[event magnification] |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
151 |
b:0.0]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
152 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
153 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
154 |
- (void)rotateWithEvent:(NSEvent *)event { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
155 |
[self postGesture:event |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
156 |
as:com_apple_eawt_event_GestureHandler_ROTATE |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
157 |
a:[event rotation] |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
158 |
b:0.0]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
159 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
160 |
|
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
161 |
- (void)swipeWithEvent:(NSEvent *)event { |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
162 |
[self postGesture:event |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
163 |
as:com_apple_eawt_event_GestureHandler_SWIPE |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
164 |
a:[event deltaX] |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
165 |
b:[event deltaY]]; |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
166 |
} |
157ebec4d375
8057788: [macosx] "Pinch to zoom" does not work since jdk7
denis
parents:
26751
diff
changeset
|
167 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
168 |
@end |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
169 |
@implementation AWTWindow_Panel |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
170 |
AWT_NS_WINDOW_IMPLEMENTATION |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
171 |
@end |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
172 |
// END of NSWindow/NSPanel descendants implementation |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
173 |
// -------------------------------------------------------------- |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
174 |
|
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
175 |
|
12047 | 176 |
@implementation AWTWindow |
177 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
178 |
@synthesize nsWindow; |
12047 | 179 |
@synthesize javaPlatformWindow; |
180 |
@synthesize javaMenuBar; |
|
181 |
@synthesize javaMinSize; |
|
182 |
@synthesize javaMaxSize; |
|
183 |
@synthesize styleBits; |
|
12640 | 184 |
@synthesize isEnabled; |
19021 | 185 |
@synthesize ownerWindow; |
21282
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
186 |
@synthesize preFullScreenLevel; |
30944
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
187 |
@synthesize standardFrame; |
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
188 |
@synthesize isMinimizing; |
12047 | 189 |
|
190 |
- (void) updateMinMaxSize:(BOOL)resizable { |
|
191 |
if (resizable) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
192 |
[self.nsWindow setMinSize:self.javaMinSize]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
193 |
[self.nsWindow setMaxSize:self.javaMaxSize]; |
12047 | 194 |
} else { |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
195 |
NSRect currentFrame = [self.nsWindow frame]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
196 |
[self.nsWindow setMinSize:currentFrame.size]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
197 |
[self.nsWindow setMaxSize:currentFrame.size]; |
12047 | 198 |
} |
199 |
} |
|
200 |
||
201 |
// creates a new NSWindow style mask based on the _STYLE_PROP_BITMASK bits |
|
202 |
+ (NSUInteger) styleMaskForStyleBits:(jint)styleBits { |
|
203 |
NSUInteger type = 0; |
|
204 |
if (IS(styleBits, DECORATED)) { |
|
205 |
type |= NSTitledWindowMask; |
|
206 |
if (IS(styleBits, CLOSEABLE)) type |= NSClosableWindowMask; |
|
207 |
if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask; |
|
208 |
if (IS(styleBits, RESIZABLE)) type |= NSResizableWindowMask; |
|
209 |
} else { |
|
210 |
type |= NSBorderlessWindowMask; |
|
211 |
} |
|
212 |
||
12177
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
213 |
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask; |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
214 |
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask; |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
215 |
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask; |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
216 |
if (IS(styleBits, HUD)) type |= NSHUDWindowMask; |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
217 |
if (IS(styleBits, SHEET)) type |= NSDocModalWindowMask; |
7b84ed7d0efa
7150349: [macosx] Applets attempting to show popup menus activate the applet process
dcherepanov
parents:
12047
diff
changeset
|
218 |
if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask; |
12047 | 219 |
|
220 |
return type; |
|
221 |
} |
|
222 |
||
223 |
// updates _METHOD_PROP_BITMASK based properties on the window |
|
224 |
- (void) setPropertiesForStyleBits:(jint)bits mask:(jint)mask { |
|
225 |
if (IS(mask, RESIZABLE)) { |
|
226 |
BOOL resizable = IS(bits, RESIZABLE); |
|
227 |
[self updateMinMaxSize:resizable]; |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
228 |
[self.nsWindow setShowsResizeIndicator:resizable]; |
14648
2ef7c7edb4b0
7193214: Consider simplifying CPlatformWindow.setResizable()
serb
parents:
14311
diff
changeset
|
229 |
// Zoom button should be disabled, if the window is not resizable, |
2ef7c7edb4b0
7193214: Consider simplifying CPlatformWindow.setResizable()
serb
parents:
14311
diff
changeset
|
230 |
// otherwise button should be restored to initial state. |
2ef7c7edb4b0
7193214: Consider simplifying CPlatformWindow.setResizable()
serb
parents:
14311
diff
changeset
|
231 |
BOOL zoom = resizable && IS(bits, ZOOMABLE); |
2ef7c7edb4b0
7193214: Consider simplifying CPlatformWindow.setResizable()
serb
parents:
14311
diff
changeset
|
232 |
[[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:zoom]; |
12047 | 233 |
} |
234 |
||
235 |
if (IS(mask, HAS_SHADOW)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
236 |
[self.nsWindow setHasShadow:IS(bits, HAS_SHADOW)]; |
12047 | 237 |
} |
238 |
||
239 |
if (IS(mask, ZOOMABLE)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
240 |
[[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled:IS(bits, ZOOMABLE)]; |
12047 | 241 |
} |
242 |
||
243 |
if (IS(mask, ALWAYS_ON_TOP)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
244 |
[self.nsWindow setLevel:IS(bits, ALWAYS_ON_TOP) ? NSFloatingWindowLevel : NSNormalWindowLevel]; |
12047 | 245 |
} |
246 |
||
247 |
if (IS(mask, HIDES_ON_DEACTIVATE)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
248 |
[self.nsWindow setHidesOnDeactivate:IS(bits, HIDES_ON_DEACTIVATE)]; |
12047 | 249 |
} |
250 |
||
251 |
if (IS(mask, DRAGGABLE_BACKGROUND)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
252 |
[self.nsWindow setMovableByWindowBackground:IS(bits, DRAGGABLE_BACKGROUND)]; |
12047 | 253 |
} |
254 |
||
255 |
if (IS(mask, DOCUMENT_MODIFIED)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
256 |
[self.nsWindow setDocumentEdited:IS(bits, DOCUMENT_MODIFIED)]; |
12047 | 257 |
} |
258 |
||
13777
c94cf7e1bac2
7197320: [macosx] Full Screen option missing when Window.documentModified
alexsch
parents:
13647
diff
changeset
|
259 |
if (IS(mask, FULLSCREENABLE) && [self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) { |
c94cf7e1bac2
7197320: [macosx] Full Screen option missing when Window.documentModified
alexsch
parents:
13647
diff
changeset
|
260 |
if (IS(bits, FULLSCREENABLE)) { |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
261 |
[self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/]; |
12047 | 262 |
} else { |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
263 |
[self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault]; |
12047 | 264 |
} |
265 |
} |
|
266 |
||
267 |
} |
|
268 |
||
269 |
- (id) initWithPlatformWindow:(JNFWeakJObjectWrapper *)platformWindow |
|
19021 | 270 |
ownerWindow:owner |
12047 | 271 |
styleBits:(jint)bits |
272 |
frameRect:(NSRect)rect |
|
273 |
contentView:(NSView *)view |
|
274 |
{ |
|
275 |
AWT_ASSERT_APPKIT_THREAD; |
|
276 |
||
277 |
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:bits]; |
|
278 |
NSRect contentRect = rect; //[NSWindow contentRectForFrameRect:rect styleMask:styleMask]; |
|
279 |
if (contentRect.size.width <= 0.0) { |
|
280 |
contentRect.size.width = 1.0; |
|
281 |
} |
|
282 |
if (contentRect.size.height <= 0.0) { |
|
283 |
contentRect.size.height = 1.0; |
|
284 |
} |
|
285 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
286 |
self = [super init]; |
12047 | 287 |
|
288 |
if (self == nil) return nil; // no hope |
|
289 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
290 |
if (IS(bits, UTILITY) || |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
291 |
IS(bits, NONACTIVATING) || |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
292 |
IS(bits, HUD) || |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
293 |
IS(bits, HIDES_ON_DEACTIVATE)) |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
294 |
{ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
295 |
self.nsWindow = [[AWTWindow_Panel alloc] initWithDelegate:self |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
296 |
frameRect:contentRect |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
297 |
styleMask:styleMask |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
298 |
contentView:view]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
299 |
} |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
300 |
else |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
301 |
{ |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
302 |
// These windows will appear in the window list in the dock icon menu |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
303 |
self.nsWindow = [[AWTWindow_Normal alloc] initWithDelegate:self |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
304 |
frameRect:contentRect |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
305 |
styleMask:styleMask |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
306 |
contentView:view]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
307 |
} |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
308 |
|
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
309 |
if (self.nsWindow == nil) return nil; // no hope either |
13009
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
310 |
[self.nsWindow release]; // the property retains the object already |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
311 |
|
12640 | 312 |
self.isEnabled = YES; |
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
313 |
self.isMinimizing = NO; |
12047 | 314 |
self.javaPlatformWindow = platformWindow; |
315 |
self.styleBits = bits; |
|
19021 | 316 |
self.ownerWindow = owner; |
12047 | 317 |
[self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)]; |
318 |
||
25120
8b6a41c3752f
8042465: Applet menus not rendering when browser is full screen on Mac
dmarkov
parents:
24534
diff
changeset
|
319 |
if (IS(self.styleBits, IS_POPUP)) { |
8b6a41c3752f
8042465: Applet menus not rendering when browser is full screen on Mac
dmarkov
parents:
24534
diff
changeset
|
320 |
[self.nsWindow setCollectionBehavior:(1 << 8) /*NSWindowCollectionBehaviorFullScreenAuxiliary*/]; |
8b6a41c3752f
8042465: Applet menus not rendering when browser is full screen on Mac
dmarkov
parents:
24534
diff
changeset
|
321 |
} |
8b6a41c3752f
8042465: Applet menus not rendering when browser is full screen on Mac
dmarkov
parents:
24534
diff
changeset
|
322 |
|
12047 | 323 |
return self; |
324 |
} |
|
325 |
||
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
326 |
+ (BOOL) isAWTWindow:(NSWindow *)window { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
327 |
return [window isKindOfClass: [AWTWindow_Panel class]] || [window isKindOfClass: [AWTWindow_Normal class]]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
328 |
} |
12640 | 329 |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
330 |
// returns id for the topmost window under mouse |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
331 |
+ (NSInteger) getTopmostWindowUnderMouseID { |
24534
07cf38b730b5
8041572: [macosx] huge native memory leak in AWTWindow.m
pchelko
parents:
24134
diff
changeset
|
332 |
NSInteger result = -1; |
07cf38b730b5
8041572: [macosx] huge native memory leak in AWTWindow.m
pchelko
parents:
24134
diff
changeset
|
333 |
|
12640 | 334 |
NSRect screenRect = [[NSScreen mainScreen] frame]; |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
335 |
NSPoint nsMouseLocation = [NSEvent mouseLocation]; |
12640 | 336 |
CGPoint cgMouseLocation = CGPointMake(nsMouseLocation.x, screenRect.size.height - nsMouseLocation.y); |
337 |
||
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
338 |
NSMutableArray *windows = (NSMutableArray *)CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID); |
12640 | 339 |
|
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
340 |
for (NSDictionary *window in windows) { |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
341 |
NSInteger layer = [[window objectForKey:(id)kCGWindowLayer] integerValue]; |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
342 |
if (layer == 0) { |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
343 |
CGRect rect; |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
344 |
CGRectMakeWithDictionaryRepresentation((CFDictionaryRef)[window objectForKey:(id)kCGWindowBounds], &rect); |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
345 |
if (CGRectContainsPoint(rect, cgMouseLocation)) { |
24534
07cf38b730b5
8041572: [macosx] huge native memory leak in AWTWindow.m
pchelko
parents:
24134
diff
changeset
|
346 |
result = [[window objectForKey:(id)kCGWindowNumber] integerValue]; |
07cf38b730b5
8041572: [macosx] huge native memory leak in AWTWindow.m
pchelko
parents:
24134
diff
changeset
|
347 |
break; |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
348 |
} |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
349 |
} |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
350 |
} |
24534
07cf38b730b5
8041572: [macosx] huge native memory leak in AWTWindow.m
pchelko
parents:
24134
diff
changeset
|
351 |
[windows release]; |
07cf38b730b5
8041572: [macosx] huge native memory leak in AWTWindow.m
pchelko
parents:
24134
diff
changeset
|
352 |
return result; |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
353 |
} |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
354 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
355 |
// checks that this window is under the mouse cursor and this point is not overlapped by others windows |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
356 |
- (BOOL) isTopmostWindowUnderMouse { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
357 |
return [self.nsWindow windowNumber] == [AWTWindow getTopmostWindowUnderMouseID]; |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
358 |
} |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
359 |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
360 |
+ (AWTWindow *) getTopmostWindowUnderMouse { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
361 |
NSEnumerator *windowEnumerator = [[NSApp windows] objectEnumerator]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
362 |
NSWindow *window; |
12640 | 363 |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
364 |
NSInteger topmostWindowUnderMouseID = [AWTWindow getTopmostWindowUnderMouseID]; |
12640 | 365 |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
366 |
while ((window = [windowEnumerator nextObject]) != nil) { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
367 |
if ([window windowNumber] == topmostWindowUnderMouseID) { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
368 |
BOOL isAWTWindow = [AWTWindow isAWTWindow: window]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
369 |
return isAWTWindow ? (AWTWindow *) [window delegate] : nil; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
370 |
} |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
371 |
} |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
372 |
return nil; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
373 |
} |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
374 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
375 |
+ (void) synthesizeMouseEnteredExitedEvents:(NSWindow*)window withType:(NSEventType)eventType { |
12640 | 376 |
|
377 |
NSPoint screenLocation = [NSEvent mouseLocation]; |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
378 |
NSPoint windowLocation = [window convertScreenToBase: screenLocation]; |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
379 |
int modifierFlags = (eventType == NSMouseEntered) ? NSMouseEnteredMask : NSMouseExitedMask; |
12640 | 380 |
|
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
381 |
NSEvent *mouseEvent = [NSEvent enterExitEventWithType: eventType |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
382 |
location: windowLocation |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
383 |
modifierFlags: modifierFlags |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
384 |
timestamp: 0 |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
385 |
windowNumber: [window windowNumber] |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
386 |
context: nil |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
387 |
eventNumber: 0 |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
388 |
trackingNumber: 0 |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
389 |
userData: nil |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
390 |
]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
391 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
392 |
[[window contentView] deliverJavaMouseEvent: mouseEvent]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
393 |
} |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
394 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
395 |
+ (void) synthesizeMouseEnteredExitedEventsForAllWindows { |
12640 | 396 |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
397 |
NSInteger topmostWindowUnderMouseID = [AWTWindow getTopmostWindowUnderMouseID]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
398 |
NSArray *windows = [NSApp windows]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
399 |
NSWindow *window; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
400 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
401 |
NSEnumerator *windowEnumerator = [windows objectEnumerator]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
402 |
while ((window = [windowEnumerator nextObject]) != nil) { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
403 |
if ([AWTWindow isAWTWindow: window]) { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
404 |
BOOL isUnderMouse = ([window windowNumber] == topmostWindowUnderMouseID); |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
405 |
BOOL mouseIsOver = [[window contentView] mouseIsOver]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
406 |
if (isUnderMouse && !mouseIsOver) { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
407 |
[AWTWindow synthesizeMouseEnteredExitedEvents:window withType:NSMouseEntered]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
408 |
} else if (!isUnderMouse && mouseIsOver) { |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
409 |
[AWTWindow synthesizeMouseEnteredExitedEvents:window withType:NSMouseExited]; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
410 |
} |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
411 |
} |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
412 |
} |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
413 |
} |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
414 |
|
14165
dcb1f9388f85
7175707: [macosx] PIT: 8 b43 Not running on AppKit thread issue again
alexsch
parents:
13777
diff
changeset
|
415 |
+ (NSNumber *) getNSWindowDisplayID_AppKitThread:(NSWindow *)window { |
dcb1f9388f85
7175707: [macosx] PIT: 8 b43 Not running on AppKit thread issue again
alexsch
parents:
13777
diff
changeset
|
416 |
AWT_ASSERT_APPKIT_THREAD; |
dcb1f9388f85
7175707: [macosx] PIT: 8 b43 Not running on AppKit thread issue again
alexsch
parents:
13777
diff
changeset
|
417 |
NSScreen *screen = [window screen]; |
dcb1f9388f85
7175707: [macosx] PIT: 8 b43 Not running on AppKit thread issue again
alexsch
parents:
13777
diff
changeset
|
418 |
NSDictionary *deviceDescription = [screen deviceDescription]; |
dcb1f9388f85
7175707: [macosx] PIT: 8 b43 Not running on AppKit thread issue again
alexsch
parents:
13777
diff
changeset
|
419 |
return [deviceDescription objectForKey:@"NSScreenNumber"]; |
dcb1f9388f85
7175707: [macosx] PIT: 8 b43 Not running on AppKit thread issue again
alexsch
parents:
13777
diff
changeset
|
420 |
} |
dcb1f9388f85
7175707: [macosx] PIT: 8 b43 Not running on AppKit thread issue again
alexsch
parents:
13777
diff
changeset
|
421 |
|
12047 | 422 |
- (void) dealloc { |
423 |
AWT_ASSERT_APPKIT_THREAD; |
|
424 |
||
20139 | 425 |
JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; |
12047 | 426 |
[self.javaPlatformWindow setJObject:nil withEnv:env]; |
427 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
428 |
self.nsWindow = nil; |
19021 | 429 |
self.ownerWindow = nil; |
12047 | 430 |
[super dealloc]; |
431 |
} |
|
432 |
||
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
433 |
// Tests wheather the corresponding Java paltform window is visible or not |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
434 |
+ (BOOL) isJavaPlatformWindowVisible:(NSWindow *)window { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
435 |
BOOL isVisible = NO; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
436 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
437 |
if ([AWTWindow isAWTWindow:window] && [window delegate] != nil) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
438 |
AWTWindow *awtWindow = (AWTWindow *)[window delegate]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
439 |
[AWTToolkit eventCountPlusPlus]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
440 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
441 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
442 |
jobject platformWindow = [awtWindow.javaPlatformWindow jObjectWithEnv:env]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
443 |
if (platformWindow != NULL) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
444 |
static JNF_MEMBER_CACHE(jm_isVisible, jc_CPlatformWindow, "isVisible", "()Z"); |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
445 |
isVisible = JNFCallBooleanMethod(env, platformWindow, jm_isVisible) == JNI_TRUE ? YES : NO; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
446 |
(*env)->DeleteLocalRef(env, platformWindow); |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
447 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
448 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
449 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
450 |
return isVisible; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
451 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
452 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
453 |
// Orders window's childs based on the current focus state |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
454 |
- (void) orderChildWindows:(BOOL)focus { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
455 |
AWT_ASSERT_APPKIT_THREAD; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
456 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
457 |
if (self.isMinimizing) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
458 |
// Do not perform any ordering, if iconify is in progress |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
459 |
return; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
460 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
461 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
462 |
NSEnumerator *windowEnumerator = [[NSApp windows]objectEnumerator]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
463 |
NSWindow *window; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
464 |
while ((window = [windowEnumerator nextObject]) != nil) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
465 |
if ([AWTWindow isJavaPlatformWindowVisible:window]) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
466 |
AWTWindow *awtWindow = (AWTWindow *)[window delegate]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
467 |
AWTWindow *owner = awtWindow.ownerWindow; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
468 |
if (IS(awtWindow.styleBits, ALWAYS_ON_TOP)) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
469 |
// Do not order 'always on top' windows |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
470 |
continue; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
471 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
472 |
while (awtWindow.ownerWindow != nil) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
473 |
if (awtWindow.ownerWindow == self) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
474 |
if (focus) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
475 |
// Move the childWindow to floating level |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
476 |
// so it will appear in front of its |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
477 |
// parent which owns the focus |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
478 |
[window setLevel:NSFloatingWindowLevel]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
479 |
} else { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
480 |
// Focus owner has changed, move the childWindow |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
481 |
// back to normal window level |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
482 |
[window setLevel:NSNormalWindowLevel]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
483 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
484 |
// The childWindow should be displayed in front of |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
485 |
// its nearest parentWindow |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
486 |
[window orderWindow:NSWindowAbove relativeTo:[owner.nsWindow windowNumber]]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
487 |
break; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
488 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
489 |
awtWindow = awtWindow.ownerWindow; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
490 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
491 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
492 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
493 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
494 |
|
12047 | 495 |
// NSWindow overrides |
496 |
- (BOOL) canBecomeKeyWindow { |
|
497 |
AWT_ASSERT_APPKIT_THREAD; |
|
12640 | 498 |
return self.isEnabled && IS(self.styleBits, SHOULD_BECOME_KEY); |
12047 | 499 |
} |
500 |
||
501 |
- (BOOL) canBecomeMainWindow { |
|
502 |
AWT_ASSERT_APPKIT_THREAD; |
|
20456
91f08f6b7871
8025438: [macosx] right JNFCall* method should be used in JDK-8008728 fix
alexsch
parents:
20139
diff
changeset
|
503 |
if (!self.isEnabled) { |
20135
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
504 |
// Native system can bring up the NSWindow to |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
505 |
// the top even if the window is not main. |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
506 |
// We should bring up the modal dialog manually |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
507 |
[AWTToolkit eventCountPlusPlus]; |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
508 |
|
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
509 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
510 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
511 |
if (platformWindow != NULL) { |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
512 |
static JNF_MEMBER_CACHE(jm_checkBlockingAndOrder, jc_CPlatformWindow, |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
513 |
"checkBlockingAndOrder", "()Z"); |
20456
91f08f6b7871
8025438: [macosx] right JNFCall* method should be used in JDK-8008728 fix
alexsch
parents:
20139
diff
changeset
|
514 |
JNFCallBooleanMethod(env, platformWindow, jm_checkBlockingAndOrder); |
20135
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
515 |
(*env)->DeleteLocalRef(env, platformWindow); |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
516 |
} |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
517 |
} |
f6edca5afe49
8008728: [macosx] Swing. JDialog. Modal dialog goes to background
alexsch
parents:
19022
diff
changeset
|
518 |
|
12640 | 519 |
return self.isEnabled && IS(self.styleBits, SHOULD_BECOME_MAIN); |
12047 | 520 |
} |
521 |
||
522 |
- (BOOL) worksWhenModal { |
|
523 |
AWT_ASSERT_APPKIT_THREAD; |
|
524 |
return IS(self.styleBits, MODAL_EXCLUDED); |
|
525 |
} |
|
526 |
||
527 |
||
528 |
// NSWindowDelegate methods |
|
529 |
||
530 |
- (void) _deliverMoveResizeEvent { |
|
531 |
AWT_ASSERT_APPKIT_THREAD; |
|
532 |
||
533 |
// deliver the event if this is a user-initiated live resize or as a side-effect |
|
534 |
// of a Java initiated resize, because AppKit can override the bounds and force |
|
535 |
// the bounds of the window to avoid the Dock or remain on screen. |
|
536 |
[AWTToolkit eventCountPlusPlus]; |
|
537 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
538 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
539 |
if (platformWindow == NULL) { |
|
540 |
// TODO: create generic AWT assert |
|
541 |
} |
|
542 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
543 |
NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]); |
12047 | 544 |
|
14651
f032406c1e48
8002308: [macosx] 7198229 should be applied to the user action only
serb
parents:
14648
diff
changeset
|
545 |
static JNF_MEMBER_CACHE(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V"); |
12047 | 546 |
JNFCallVoidMethod(env, platformWindow, jm_deliverMoveResizeEvent, |
547 |
(jint)frame.origin.x, |
|
548 |
(jint)frame.origin.y, |
|
549 |
(jint)frame.size.width, |
|
14651
f032406c1e48
8002308: [macosx] 7198229 should be applied to the user action only
serb
parents:
14648
diff
changeset
|
550 |
(jint)frame.size.height, |
f032406c1e48
8002308: [macosx] 7198229 should be applied to the user action only
serb
parents:
14648
diff
changeset
|
551 |
(jboolean)[self.nsWindow inLiveResize]); |
12047 | 552 |
(*env)->DeleteLocalRef(env, platformWindow); |
21788
38ffbbef9235
8028485: [macosx] java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java fails
pchelko
parents:
21282
diff
changeset
|
553 |
|
38ffbbef9235
8028485: [macosx] java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java fails
pchelko
parents:
21282
diff
changeset
|
554 |
[AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; |
12047 | 555 |
} |
556 |
||
557 |
- (void)windowDidMove:(NSNotification *)notification { |
|
558 |
AWT_ASSERT_APPKIT_THREAD; |
|
559 |
||
560 |
[self _deliverMoveResizeEvent]; |
|
561 |
} |
|
562 |
||
563 |
- (void)windowDidResize:(NSNotification *)notification { |
|
564 |
AWT_ASSERT_APPKIT_THREAD; |
|
565 |
||
566 |
[self _deliverMoveResizeEvent]; |
|
567 |
} |
|
568 |
||
569 |
- (void)windowDidExpose:(NSNotification *)notification { |
|
570 |
AWT_ASSERT_APPKIT_THREAD; |
|
571 |
||
572 |
[AWTToolkit eventCountPlusPlus]; |
|
573 |
// TODO: don't see this callback invoked anytime so we track |
|
574 |
// window exposing in _setVisible:(BOOL) |
|
575 |
} |
|
576 |
||
30944
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
577 |
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
578 |
defaultFrame:(NSRect)newFrame { |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
579 |
|
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
580 |
return [self standardFrame]; |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
581 |
} |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
582 |
|
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
583 |
// Hides/shows window's childs during iconify/de-iconify operation |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
584 |
- (void) iconifyChildWindows:(BOOL)iconify { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
585 |
AWT_ASSERT_APPKIT_THREAD; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
586 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
587 |
NSEnumerator *windowEnumerator = [[NSApp windows]objectEnumerator]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
588 |
NSWindow *window; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
589 |
while ((window = [windowEnumerator nextObject]) != nil) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
590 |
if ([AWTWindow isJavaPlatformWindowVisible:window]) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
591 |
AWTWindow *awtWindow = (AWTWindow *)[window delegate]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
592 |
while (awtWindow.ownerWindow != nil) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
593 |
if (awtWindow.ownerWindow == self) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
594 |
if (iconify) { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
595 |
[window orderOut:window]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
596 |
} else { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
597 |
[window orderFront:window]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
598 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
599 |
break; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
600 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
601 |
awtWindow = awtWindow.ownerWindow; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
602 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
603 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
604 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
605 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
606 |
|
12047 | 607 |
- (void) _deliverIconify:(BOOL)iconify { |
608 |
AWT_ASSERT_APPKIT_THREAD; |
|
609 |
||
610 |
[AWTToolkit eventCountPlusPlus]; |
|
611 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
612 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
613 |
if (platformWindow != NULL) { |
|
614 |
static JNF_MEMBER_CACHE(jm_deliverIconify, jc_CPlatformWindow, "deliverIconify", "(Z)V"); |
|
615 |
JNFCallVoidMethod(env, platformWindow, jm_deliverIconify, iconify); |
|
616 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
617 |
} |
|
618 |
} |
|
619 |
||
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
620 |
- (void)windowWillMiniaturize:(NSNotification *)notification { |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
621 |
AWT_ASSERT_APPKIT_THREAD; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
622 |
|
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
623 |
self.isMinimizing = YES; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
624 |
// Excplicitly make myself a key window to avoid possible |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
625 |
// negative visual effects during iconify operation |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
626 |
[self.nsWindow makeKeyAndOrderFront:self.nsWindow]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
627 |
[self iconifyChildWindows:YES]; |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
628 |
} |
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
629 |
|
12047 | 630 |
- (void)windowDidMiniaturize:(NSNotification *)notification { |
631 |
AWT_ASSERT_APPKIT_THREAD; |
|
632 |
||
633 |
[self _deliverIconify:JNI_TRUE]; |
|
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
634 |
self.isMinimizing = NO; |
12047 | 635 |
} |
636 |
||
637 |
- (void)windowDidDeminiaturize:(NSNotification *)notification { |
|
638 |
AWT_ASSERT_APPKIT_THREAD; |
|
639 |
||
640 |
[self _deliverIconify:JNI_FALSE]; |
|
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
641 |
[self iconifyChildWindows:NO]; |
12047 | 642 |
} |
643 |
||
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
644 |
- (void) _deliverWindowFocusEvent:(BOOL)focused oppositeWindow:(AWTWindow *)opposite { |
12047 | 645 |
//AWT_ASSERT_APPKIT_THREAD; |
646 |
JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; |
|
647 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
648 |
if (platformWindow != NULL) { |
|
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
649 |
jobject oppositeWindow = [opposite.javaPlatformWindow jObjectWithEnv:env]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
650 |
|
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
651 |
static JNF_MEMBER_CACHE(jm_deliverWindowFocusEvent, jc_CPlatformWindow, "deliverWindowFocusEvent", "(ZLsun/lwawt/macosx/CPlatformWindow;)V"); |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
652 |
JNFCallVoidMethod(env, platformWindow, jm_deliverWindowFocusEvent, (jboolean)focused, oppositeWindow); |
12047 | 653 |
(*env)->DeleteLocalRef(env, platformWindow); |
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
654 |
(*env)->DeleteLocalRef(env, oppositeWindow); |
12047 | 655 |
} |
656 |
} |
|
657 |
||
658 |
||
659 |
- (void) windowDidBecomeKey: (NSNotification *) notification { |
|
660 |
AWT_ASSERT_APPKIT_THREAD; |
|
661 |
[AWTToolkit eventCountPlusPlus]; |
|
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
662 |
AWTWindow *opposite = [AWTWindow lastKeyWindow]; |
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
663 |
|
19021 | 664 |
// Finds appropriate menubar in our hierarchy, |
665 |
AWTWindow *awtWindow = self; |
|
666 |
while (awtWindow.ownerWindow != nil) { |
|
667 |
awtWindow = awtWindow.ownerWindow; |
|
17684
fc7f8dbe87b4
8010721: [macosx] In JDK7 the menu bar disappears when a Dialog is shown
vkarnauk
parents:
15505
diff
changeset
|
668 |
} |
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
669 |
|
19021 | 670 |
CMenuBar *menuBar = nil; |
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
671 |
BOOL isDisabled = NO; |
19021 | 672 |
if ([awtWindow.nsWindow isVisible]){ |
673 |
menuBar = awtWindow.javaMenuBar; |
|
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
674 |
isDisabled = !awtWindow.isEnabled; |
19021 | 675 |
} |
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
676 |
|
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
677 |
if (menuBar == nil) { |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
678 |
menuBar = [[ApplicationDelegate sharedDelegate] defaultMenuBar]; |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
679 |
isDisabled = NO; |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
680 |
} |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
681 |
|
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
682 |
[CMenuBar activate:menuBar modallyDisabled:isDisabled]; |
19021 | 683 |
|
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
684 |
[AWTWindow setLastKeyWindow:nil]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
685 |
|
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
686 |
[self _deliverWindowFocusEvent:YES oppositeWindow: opposite]; |
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
687 |
[self orderChildWindows:YES]; |
12047 | 688 |
} |
689 |
||
690 |
- (void) windowDidResignKey: (NSNotification *) notification { |
|
691 |
// TODO: check why sometimes at start is invoked *not* on AppKit main thread. |
|
692 |
AWT_ASSERT_APPKIT_THREAD; |
|
693 |
[AWTToolkit eventCountPlusPlus]; |
|
694 |
[self.javaMenuBar deactivate]; |
|
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
695 |
|
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
696 |
// In theory, this might cause flickering if the window gaining focus |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
697 |
// has its own menu. However, I couldn't reproduce it on practice, so |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
698 |
// perhaps this is a non issue. |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
699 |
CMenuBar* defaultMenu = [[ApplicationDelegate sharedDelegate] defaultMenuBar]; |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
700 |
if (defaultMenu != nil) { |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
701 |
[CMenuBar activate:defaultMenu modallyDisabled:NO]; |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
702 |
} |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
703 |
|
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
704 |
// the new key window |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
705 |
NSWindow *keyWindow = [NSApp keyWindow]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
706 |
AWTWindow *opposite = nil; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
707 |
if ([AWTWindow isAWTWindow: keyWindow]) { |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
708 |
opposite = (AWTWindow *)[keyWindow delegate]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
709 |
[AWTWindow setLastKeyWindow: self]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
710 |
} else { |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
711 |
[AWTWindow setLastKeyWindow: nil]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
712 |
} |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
713 |
|
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
714 |
[self _deliverWindowFocusEvent:NO oppositeWindow: opposite]; |
38970
aabcf4406038
8080729: [macosx] java 7 and 8 JDialogs on multiscreen jump to parent frame on focus
dmarkov
parents:
32872
diff
changeset
|
715 |
[self orderChildWindows:NO]; |
12047 | 716 |
} |
717 |
||
718 |
- (void) windowDidBecomeMain: (NSNotification *) notification { |
|
719 |
AWT_ASSERT_APPKIT_THREAD; |
|
720 |
[AWTToolkit eventCountPlusPlus]; |
|
721 |
||
722 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
723 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
724 |
if (platformWindow != NULL) { |
|
725 |
static JNF_MEMBER_CACHE(jm_windowDidBecomeMain, jc_CPlatformWindow, "windowDidBecomeMain", "()V"); |
|
726 |
JNFCallVoidMethod(env, platformWindow, jm_windowDidBecomeMain); |
|
727 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
728 |
} |
|
729 |
} |
|
730 |
||
731 |
- (BOOL)windowShouldClose:(id)sender { |
|
732 |
AWT_ASSERT_APPKIT_THREAD; |
|
733 |
[AWTToolkit eventCountPlusPlus]; |
|
734 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
735 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
736 |
if (platformWindow != NULL) { |
|
737 |
static JNF_MEMBER_CACHE(jm_deliverWindowClosingEvent, jc_CPlatformWindow, "deliverWindowClosingEvent", "()V"); |
|
738 |
JNFCallVoidMethod(env, platformWindow, jm_deliverWindowClosingEvent); |
|
739 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
740 |
} |
|
741 |
// The window will be closed (if allowed) as result of sending Java event |
|
742 |
return NO; |
|
743 |
} |
|
744 |
||
745 |
||
746 |
- (void)_notifyFullScreenOp:(jint)op withEnv:(JNIEnv *)env { |
|
747 |
static JNF_CLASS_CACHE(jc_FullScreenHandler, "com/apple/eawt/FullScreenHandler"); |
|
748 |
static JNF_STATIC_MEMBER_CACHE(jm_notifyFullScreenOperation, jc_FullScreenHandler, "handleFullScreenEventFromNative", "(Ljava/awt/Window;I)V"); |
|
749 |
static JNF_MEMBER_CACHE(jf_target, jc_CPlatformWindow, "target", "Ljava/awt/Window;"); |
|
750 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
751 |
if (platformWindow != NULL) { |
|
752 |
jobject awtWindow = JNFGetObjectField(env, platformWindow, jf_target); |
|
753 |
if (awtWindow != NULL) { |
|
754 |
JNFCallStaticVoidMethod(env, jm_notifyFullScreenOperation, awtWindow, op); |
|
755 |
(*env)->DeleteLocalRef(env, awtWindow); |
|
756 |
} |
|
757 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
758 |
} |
|
759 |
} |
|
760 |
||
761 |
||
762 |
- (void)windowWillEnterFullScreen:(NSNotification *)notification { |
|
763 |
static JNF_MEMBER_CACHE(jm_windowWillEnterFullScreen, jc_CPlatformWindow, "windowWillEnterFullScreen", "()V"); |
|
764 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
765 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
766 |
if (platformWindow != NULL) { |
|
767 |
JNFCallVoidMethod(env, platformWindow, jm_windowWillEnterFullScreen); |
|
768 |
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_WILL_ENTER withEnv:env]; |
|
769 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
770 |
} |
|
771 |
} |
|
772 |
||
773 |
- (void)windowDidEnterFullScreen:(NSNotification *)notification { |
|
774 |
static JNF_MEMBER_CACHE(jm_windowDidEnterFullScreen, jc_CPlatformWindow, "windowDidEnterFullScreen", "()V"); |
|
775 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
776 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
777 |
if (platformWindow != NULL) { |
|
778 |
JNFCallVoidMethod(env, platformWindow, jm_windowDidEnterFullScreen); |
|
779 |
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_ENTER withEnv:env]; |
|
780 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
781 |
} |
|
18129
614a4d36d8c7
8013468: [macosx] Cursor does not update properly when in fullscreen mode on Mac
pchelko
parents:
17904
diff
changeset
|
782 |
[AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; |
12047 | 783 |
} |
784 |
||
785 |
- (void)windowWillExitFullScreen:(NSNotification *)notification { |
|
786 |
static JNF_MEMBER_CACHE(jm_windowWillExitFullScreen, jc_CPlatformWindow, "windowWillExitFullScreen", "()V"); |
|
787 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
788 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
789 |
if (platformWindow != NULL) { |
|
790 |
JNFCallVoidMethod(env, platformWindow, jm_windowWillExitFullScreen); |
|
791 |
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_WILL_EXIT withEnv:env]; |
|
792 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
793 |
} |
|
794 |
} |
|
795 |
||
796 |
- (void)windowDidExitFullScreen:(NSNotification *)notification { |
|
797 |
static JNF_MEMBER_CACHE(jm_windowDidExitFullScreen, jc_CPlatformWindow, "windowDidExitFullScreen", "()V"); |
|
798 |
JNIEnv *env = [ThreadUtilities getJNIEnv]; |
|
799 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
800 |
if (platformWindow != NULL) { |
|
801 |
JNFCallVoidMethod(env, platformWindow, jm_windowDidExitFullScreen); |
|
802 |
[self _notifyFullScreenOp:com_apple_eawt_FullScreenHandler_FULLSCREEN_DID_EXIT withEnv:env]; |
|
803 |
(*env)->DeleteLocalRef(env, platformWindow); |
|
804 |
} |
|
18129
614a4d36d8c7
8013468: [macosx] Cursor does not update properly when in fullscreen mode on Mac
pchelko
parents:
17904
diff
changeset
|
805 |
[AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; |
12047 | 806 |
} |
807 |
||
808 |
- (void)sendEvent:(NSEvent *)event { |
|
809 |
if ([event type] == NSLeftMouseDown || [event type] == NSRightMouseDown || [event type] == NSOtherMouseDown) { |
|
40446
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
810 |
// Move parent windows to front and make sure that a child window is displayed |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
811 |
// in front of its nearest parent. |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
812 |
if (self.ownerWindow != nil) { |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
813 |
JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
814 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
815 |
if (platformWindow != NULL) { |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
816 |
static JNF_MEMBER_CACHE(jm_orderAboveSiblings, jc_CPlatformWindow, "orderAboveSiblings", "()V"); |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
817 |
JNFCallVoidMethod(env,platformWindow, jm_orderAboveSiblings); |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
818 |
(*env)->DeleteLocalRef(env, platformWindow); |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
819 |
} |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
820 |
} |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
821 |
[self orderChildWindows:YES]; |
12047 | 822 |
|
823 |
NSPoint p = [NSEvent mouseLocation]; |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
824 |
NSRect frame = [self.nsWindow frame]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
825 |
NSRect contentRect = [self.nsWindow contentRectForFrameRect:frame]; |
12047 | 826 |
|
827 |
// Check if the click happened in the non-client area (title bar) |
|
828 |
if (p.y >= (frame.origin.y + contentRect.size.height)) { |
|
829 |
JNIEnv *env = [ThreadUtilities getJNIEnvUncached]; |
|
830 |
jobject platformWindow = [self.javaPlatformWindow jObjectWithEnv:env]; |
|
38987
ffe8b158dd6a
8156116: [macosx] two JNI locals to delete in AWTWindow.m, CGraphicsEnv.m
ant
parents:
38970
diff
changeset
|
831 |
if (platformWindow != NULL) { |
ffe8b158dd6a
8156116: [macosx] two JNI locals to delete in AWTWindow.m, CGraphicsEnv.m
ant
parents:
38970
diff
changeset
|
832 |
// Currently, no need to deliver the whole NSEvent. |
ffe8b158dd6a
8156116: [macosx] two JNI locals to delete in AWTWindow.m, CGraphicsEnv.m
ant
parents:
38970
diff
changeset
|
833 |
static JNF_MEMBER_CACHE(jm_deliverNCMouseDown, jc_CPlatformWindow, "deliverNCMouseDown", "()V"); |
ffe8b158dd6a
8156116: [macosx] two JNI locals to delete in AWTWindow.m, CGraphicsEnv.m
ant
parents:
38970
diff
changeset
|
834 |
JNFCallVoidMethod(env, platformWindow, jm_deliverNCMouseDown); |
ffe8b158dd6a
8156116: [macosx] two JNI locals to delete in AWTWindow.m, CGraphicsEnv.m
ant
parents:
38970
diff
changeset
|
835 |
(*env)->DeleteLocalRef(env, platformWindow); |
ffe8b158dd6a
8156116: [macosx] two JNI locals to delete in AWTWindow.m, CGraphicsEnv.m
ant
parents:
38970
diff
changeset
|
836 |
} |
12047 | 837 |
} |
838 |
} |
|
839 |
} |
|
12402
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
840 |
|
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
841 |
- (void)constrainSize:(NSSize*)size { |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
842 |
float minWidth = 0.f, minHeight = 0.f; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
843 |
|
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
844 |
if (IS(self.styleBits, DECORATED)) { |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
845 |
NSRect frame = [self.nsWindow frame]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
846 |
NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[self.nsWindow styleMask]]; |
12402
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
847 |
|
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
848 |
float top = frame.size.height - contentRect.size.height; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
849 |
float left = contentRect.origin.x - frame.origin.x; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
850 |
float bottom = contentRect.origin.y - frame.origin.y; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
851 |
float right = frame.size.width - (contentRect.size.width + left); |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
852 |
|
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
853 |
// Speculative estimation: 80 - enough for window decorations controls |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
854 |
minWidth += left + right + 80; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
855 |
minHeight += top + bottom; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
856 |
} |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
857 |
|
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
858 |
minWidth = MAX(1.f, minWidth); |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
859 |
minHeight = MAX(1.f, minHeight); |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
860 |
|
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
861 |
size->width = MAX(size->width, minWidth); |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
862 |
size->height = MAX(size->height, minHeight); |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
863 |
} |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
864 |
|
12640 | 865 |
- (void) setEnabled: (BOOL)flag { |
866 |
self.isEnabled = flag; |
|
867 |
||
868 |
if (IS(self.styleBits, CLOSEABLE)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
869 |
[[self.nsWindow standardWindowButton:NSWindowCloseButton] setEnabled: flag]; |
12640 | 870 |
} |
871 |
||
872 |
if (IS(self.styleBits, MINIMIZABLE)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
873 |
[[self.nsWindow standardWindowButton:NSWindowMiniaturizeButton] setEnabled: flag]; |
12640 | 874 |
} |
875 |
||
876 |
if (IS(self.styleBits, ZOOMABLE)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
877 |
[[self.nsWindow standardWindowButton:NSWindowZoomButton] setEnabled: flag]; |
12640 | 878 |
} |
879 |
||
880 |
if (IS(self.styleBits, RESIZABLE)) { |
|
881 |
[self updateMinMaxSize:flag]; |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
882 |
[self.nsWindow setShowsResizeIndicator:flag]; |
12640 | 883 |
} |
884 |
} |
|
885 |
||
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
886 |
+ (void) setLastKeyWindow:(AWTWindow *)window { |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
887 |
[window retain]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
888 |
[lastKeyWindow release]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
889 |
lastKeyWindow = window; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
890 |
} |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
891 |
|
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
892 |
+ (AWTWindow *) lastKeyWindow { |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
893 |
return lastKeyWindow; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
894 |
} |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
895 |
|
24134
46d80fad2e48
8032595: [macosx] setResizable(false) makes a frame slide down
pchelko
parents:
23651
diff
changeset
|
896 |
- (BOOL)windowShouldZoom:(NSWindow *)window toFrame:(NSRect)newFrame { |
46d80fad2e48
8032595: [macosx] setResizable(false) makes a frame slide down
pchelko
parents:
23651
diff
changeset
|
897 |
return !NSEqualSizes(self.nsWindow.frame.size, newFrame.size); |
46d80fad2e48
8032595: [macosx] setResizable(false) makes a frame slide down
pchelko
parents:
23651
diff
changeset
|
898 |
} |
46d80fad2e48
8032595: [macosx] setResizable(false) makes a frame slide down
pchelko
parents:
23651
diff
changeset
|
899 |
|
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
900 |
|
12047 | 901 |
@end // AWTWindow |
902 |
||
903 |
||
904 |
/* |
|
905 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
906 |
* Method: nativeCreateNSWindow |
|
907 |
* Signature: (JJIIII)J |
|
908 |
*/ |
|
909 |
JNIEXPORT jlong JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCreateNSWindow |
|
19021 | 910 |
(JNIEnv *env, jobject obj, jlong contentViewPtr, jlong ownerPtr, jlong styleBits, jdouble x, jdouble y, jdouble w, jdouble h) |
12047 | 911 |
{ |
912 |
__block AWTWindow *window = nil; |
|
913 |
||
914 |
JNF_COCOA_ENTER(env); |
|
915 |
||
916 |
JNFWeakJObjectWrapper *platformWindow = [JNFWeakJObjectWrapper wrapperWithJObject:obj withEnv:env]; |
|
917 |
NSView *contentView = OBJC(contentViewPtr); |
|
918 |
NSRect frameRect = NSMakeRect(x, y, w, h); |
|
19021 | 919 |
AWTWindow *owner = [OBJC(ownerPtr) delegate]; |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
920 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
12047 | 921 |
|
922 |
window = [[AWTWindow alloc] initWithPlatformWindow:platformWindow |
|
19021 | 923 |
ownerWindow:owner |
924 |
styleBits:styleBits |
|
925 |
frameRect:frameRect |
|
926 |
contentView:contentView]; |
|
13009
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
927 |
// the window is released is CPlatformWindow.nativeDispose() |
12047 | 928 |
|
23651
e41298d0da2f
8037099: [macosx] Remove all references to GC from native OBJ-C code
pchelko
parents:
21790
diff
changeset
|
929 |
if (window) [window.nsWindow retain]; |
12047 | 930 |
}]; |
931 |
||
932 |
JNF_COCOA_EXIT(env); |
|
933 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
934 |
return ptr_to_jlong(window ? window.nsWindow : nil); |
12047 | 935 |
} |
936 |
||
937 |
/* |
|
938 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
939 |
* Method: nativeSetNSWindowStyleBits |
|
940 |
* Signature: (JII)V |
|
941 |
*/ |
|
942 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowStyleBits |
|
943 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jint mask, jint bits) |
|
944 |
{ |
|
945 |
JNF_COCOA_ENTER(env); |
|
946 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
947 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
948 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 949 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
950 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
951 |
|
12047 | 952 |
// scans the bit field, and only updates the values requested by the mask |
953 |
// (this implicity handles the _CALLBACK_PROP_BITMASK case, since those are passive reads) |
|
954 |
jint newBits = window.styleBits & ~mask | bits & mask; |
|
955 |
||
956 |
// resets the NSWindow's style mask if the mask intersects any of those bits |
|
957 |
if (mask & MASK(_STYLE_PROP_BITMASK)) { |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
958 |
[nsWindow setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]]; |
12047 | 959 |
} |
960 |
||
961 |
// calls methods on NSWindow to change other properties, based on the mask |
|
962 |
if (mask & MASK(_METHOD_PROP_BITMASK)) { |
|
14648
2ef7c7edb4b0
7193214: Consider simplifying CPlatformWindow.setResizable()
serb
parents:
14311
diff
changeset
|
963 |
[window setPropertiesForStyleBits:newBits mask:mask]; |
12047 | 964 |
} |
965 |
||
966 |
window.styleBits = newBits; |
|
967 |
}]; |
|
968 |
||
969 |
JNF_COCOA_EXIT(env); |
|
970 |
} |
|
971 |
||
972 |
/* |
|
973 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
974 |
* Method: nativeSetNSWindowMenuBar |
|
975 |
* Signature: (JJ)V |
|
976 |
*/ |
|
977 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMenuBar |
|
978 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jlong menuBarPtr) |
|
979 |
{ |
|
980 |
JNF_COCOA_ENTER(env); |
|
981 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
982 |
NSWindow *nsWindow = OBJC(windowPtr); |
12047 | 983 |
CMenuBar *menuBar = OBJC(menuBarPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
984 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 985 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
986 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
987 |
|
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
988 |
if ([nsWindow isKeyWindow]) { |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
989 |
[window.javaMenuBar deactivate]; |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
990 |
} |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
991 |
|
12047 | 992 |
window.javaMenuBar = menuBar; |
993 |
||
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
994 |
CMenuBar* actualMenuBar = menuBar; |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
995 |
if (actualMenuBar == nil) { |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
996 |
actualMenuBar = [[ApplicationDelegate sharedDelegate] defaultMenuBar]; |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
997 |
} |
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
998 |
|
15505
f31ab5cb8bb9
8007006: [macosx] Closing subwindow loses main window menus
leonidr
parents:
15322
diff
changeset
|
999 |
if ([nsWindow isKeyWindow]) { |
19022
4d36c6935abb
8007267: [macosx] com.apple.eawt.Application.setDefaultMenuBar is not working
leonidr
parents:
19021
diff
changeset
|
1000 |
[CMenuBar activate:actualMenuBar modallyDisabled:NO]; |
15505
f31ab5cb8bb9
8007006: [macosx] Closing subwindow loses main window menus
leonidr
parents:
15322
diff
changeset
|
1001 |
} |
12047 | 1002 |
}]; |
1003 |
||
1004 |
JNF_COCOA_EXIT(env); |
|
1005 |
} |
|
1006 |
||
1007 |
/* |
|
1008 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1009 |
* Method: nativeGetNSWindowInsets |
|
1010 |
* Signature: (J)Ljava/awt/Insets; |
|
1011 |
*/ |
|
1012 |
JNIEXPORT jobject JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeGetNSWindowInsets |
|
1013 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
|
1014 |
{ |
|
1015 |
jobject ret = NULL; |
|
1016 |
||
1017 |
JNF_COCOA_ENTER(env); |
|
1018 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1019 |
NSWindow *nsWindow = OBJC(windowPtr); |
12047 | 1020 |
__block NSRect contentRect = NSZeroRect; |
1021 |
__block NSRect frame = NSZeroRect; |
|
1022 |
||
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1023 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^(){ |
12047 | 1024 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1025 |
frame = [nsWindow frame]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1026 |
contentRect = [NSWindow contentRectForFrameRect:frame styleMask:[nsWindow styleMask]]; |
12047 | 1027 |
}]; |
1028 |
||
1029 |
jint top = (jint)(frame.size.height - contentRect.size.height); |
|
1030 |
jint left = (jint)(contentRect.origin.x - frame.origin.x); |
|
1031 |
jint bottom = (jint)(contentRect.origin.y - frame.origin.y); |
|
1032 |
jint right = (jint)(frame.size.width - (contentRect.size.width + left)); |
|
1033 |
||
1034 |
static JNF_CLASS_CACHE(jc_Insets, "java/awt/Insets"); |
|
1035 |
static JNF_CTOR_CACHE(jc_Insets_ctor, jc_Insets, "(IIII)V"); |
|
1036 |
ret = JNFNewObject(env, jc_Insets_ctor, top, left, bottom, right); |
|
1037 |
||
1038 |
JNF_COCOA_EXIT(env); |
|
1039 |
return ret; |
|
1040 |
} |
|
1041 |
||
1042 |
/* |
|
1043 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1044 |
* Method: nativeSetNSWindowBounds |
|
1045 |
* Signature: (JDDDD)V |
|
1046 |
*/ |
|
1047 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowBounds |
|
1048 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble originX, jdouble originY, jdouble width, jdouble height) |
|
1049 |
{ |
|
1050 |
JNF_COCOA_ENTER(env); |
|
1051 |
||
1052 |
NSRect jrect = NSMakeRect(originX, originY, width, height); |
|
1053 |
||
1054 |
// TODO: not sure we need displayIfNeeded message in our view |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1055 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1056 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 1057 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1058 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1059 |
|
12047 | 1060 |
NSRect rect = ConvertNSScreenRect(NULL, jrect); |
12402
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1061 |
[window constrainSize:&rect.size]; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1062 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1063 |
[nsWindow setFrame:rect display:YES]; |
12047 | 1064 |
|
1065 |
// only start tracking events if pointer is above the toplevel |
|
1066 |
// TODO: should post an Entered event if YES. |
|
1067 |
NSPoint mLocation = [NSEvent mouseLocation]; |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1068 |
[nsWindow setAcceptsMouseMovedEvents:NSPointInRect(mLocation, rect)]; |
12047 | 1069 |
|
1070 |
// ensure we repaint the whole window after the resize operation |
|
1071 |
// (this will also re-enable screen updates, which were disabled above) |
|
1072 |
// TODO: send PaintEvent |
|
1073 |
}]; |
|
1074 |
||
1075 |
JNF_COCOA_EXIT(env); |
|
1076 |
} |
|
1077 |
||
1078 |
/* |
|
1079 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
30944
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1080 |
* Method: nativeSetNSWindowStandardFrame |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1081 |
* Signature: (JDDDD)V |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1082 |
*/ |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1083 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowStandardFrame |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1084 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble originX, jdouble originY, |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1085 |
jdouble width, jdouble height) |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1086 |
{ |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1087 |
JNF_COCOA_ENTER(env); |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1088 |
|
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1089 |
NSRect jrect = NSMakeRect(originX, originY, width, height); |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1090 |
|
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1091 |
NSWindow *nsWindow = OBJC(windowPtr); |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1092 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1093 |
|
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1094 |
NSRect rect = ConvertNSScreenRect(NULL, jrect); |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1095 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1096 |
window.standardFrame = rect; |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1097 |
}]; |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1098 |
|
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1099 |
JNF_COCOA_EXIT(env); |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1100 |
} |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1101 |
|
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1102 |
/* |
b24bdcb53f5a
8065739: [macosx] Frame warps to lower left of screen when
alexsch
parents:
30924
diff
changeset
|
1103 |
* Class: sun_lwawt_macosx_CPlatformWindow |
39511
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1104 |
* Method: nativeSetNSWindowLocationByPlatform |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1105 |
* Signature: (J)V |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1106 |
*/ |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1107 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowLocationByPlatform |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1108 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1109 |
{ |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1110 |
JNF_COCOA_ENTER(env); |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1111 |
|
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1112 |
NSWindow *nsWindow = OBJC(windowPtr); |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1113 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1114 |
|
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1115 |
if (NSEqualPoints(lastTopLeftPoint, NSZeroPoint)) { |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1116 |
// This is the first usage of lastTopLeftPoint. So invoke cascadeTopLeftFromPoint |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1117 |
// twice to avoid positioning the window's top left to zero-point, since it may |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1118 |
// cause negative user experience. |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1119 |
lastTopLeftPoint = [nsWindow cascadeTopLeftFromPoint:lastTopLeftPoint]; |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1120 |
} |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1121 |
lastTopLeftPoint = [nsWindow cascadeTopLeftFromPoint:lastTopLeftPoint]; |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1122 |
}]; |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1123 |
|
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1124 |
JNF_COCOA_EXIT(env); |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1125 |
} |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1126 |
|
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1127 |
/* |
a7ad23d3d161
8025130: [macosx] Frame setLocationByPlatform has no effect under Mac OS X
dmarkov
parents:
38987
diff
changeset
|
1128 |
* Class: sun_lwawt_macosx_CPlatformWindow |
12047 | 1129 |
* Method: nativeSetNSWindowMinMax |
1130 |
* Signature: (JDDDD)V |
|
1131 |
*/ |
|
1132 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMinMax |
|
1133 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jdouble minW, jdouble minH, jdouble maxW, jdouble maxH) |
|
1134 |
{ |
|
1135 |
JNF_COCOA_ENTER(env); |
|
1136 |
||
1137 |
if (minW < 1) minW = 1; |
|
1138 |
if (minH < 1) minH = 1; |
|
1139 |
if (maxW < 1) maxW = 1; |
|
1140 |
if (maxH < 1) maxH = 1; |
|
1141 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1142 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1143 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 1144 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1145 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1146 |
|
12402
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1147 |
NSSize min = { minW, minH }; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1148 |
NSSize max = { maxW, maxH }; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1149 |
|
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1150 |
[window constrainSize:&min]; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1151 |
[window constrainSize:&max]; |
f3903de3fd9e
7124553: [macosx] Need minimum size for titled Frames and JFrames
anthony
parents:
12177
diff
changeset
|
1152 |
|
12047 | 1153 |
window.javaMinSize = min; |
1154 |
window.javaMaxSize = max; |
|
1155 |
[window updateMinMaxSize:IS(window.styleBits, RESIZABLE)]; |
|
1156 |
}]; |
|
1157 |
||
1158 |
JNF_COCOA_EXIT(env); |
|
1159 |
} |
|
1160 |
||
1161 |
/* |
|
1162 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1163 |
* Method: nativePushNSWindowToBack |
|
1164 |
* Signature: (J)V |
|
1165 |
*/ |
|
1166 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowToBack |
|
1167 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
|
1168 |
{ |
|
1169 |
JNF_COCOA_ENTER(env); |
|
1170 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1171 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1172 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1173 |
[nsWindow orderBack:nil]; |
40446
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1174 |
// Order parent windows |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1175 |
AWTWindow *awtWindow = (AWTWindow*)[nsWindow delegate]; |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1176 |
while (awtWindow.ownerWindow != nil) { |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1177 |
awtWindow = awtWindow.ownerWindow; |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1178 |
if ([AWTWindow isJavaPlatformWindowVisible:awtWindow.nsWindow]) { |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1179 |
[awtWindow.nsWindow orderBack:nil]; |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1180 |
} |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1181 |
} |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1182 |
// Order child windows |
cf666940a804
8163583: [macosx] Press "To Back" button on the Dialog,the Dialog moves behind the Frame
dmarkov
parents:
39511
diff
changeset
|
1183 |
[(AWTWindow*)[nsWindow delegate] orderChildWindows:NO]; |
12047 | 1184 |
}]; |
1185 |
||
1186 |
JNF_COCOA_EXIT(env); |
|
1187 |
} |
|
1188 |
||
1189 |
/* |
|
1190 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1191 |
* Method: nativePushNSWindowToFront |
|
1192 |
* Signature: (J)V |
|
1193 |
*/ |
|
1194 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativePushNSWindowToFront |
|
1195 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
|
1196 |
{ |
|
1197 |
JNF_COCOA_ENTER(env); |
|
1198 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1199 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1200 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12047 | 1201 |
|
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1202 |
if (![nsWindow isKeyWindow]) { |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1203 |
[nsWindow makeKeyAndOrderFront:nsWindow]; |
12047 | 1204 |
} else { |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1205 |
[nsWindow orderFront:nsWindow]; |
12047 | 1206 |
} |
1207 |
}]; |
|
1208 |
||
1209 |
JNF_COCOA_EXIT(env); |
|
1210 |
} |
|
1211 |
||
1212 |
/* |
|
1213 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1214 |
* Method: nativeSetNSWindowTitle |
|
1215 |
* Signature: (JLjava/lang/String;)V |
|
1216 |
*/ |
|
1217 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowTitle |
|
1218 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jstring jtitle) |
|
1219 |
{ |
|
1220 |
JNF_COCOA_ENTER(env); |
|
1221 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1222 |
NSWindow *nsWindow = OBJC(windowPtr); |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1223 |
[nsWindow performSelectorOnMainThread:@selector(setTitle:) |
12047 | 1224 |
withObject:JNFJavaToNSString(env, jtitle) |
1225 |
waitUntilDone:NO]; |
|
1226 |
||
1227 |
JNF_COCOA_EXIT(env); |
|
1228 |
} |
|
1229 |
||
1230 |
/* |
|
1231 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1232 |
* Method: nativeRevalidateNSWindowShadow |
|
1233 |
* Signature: (J)V |
|
1234 |
*/ |
|
1235 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeRevalidateNSWindowShadow |
|
1236 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
|
1237 |
{ |
|
1238 |
JNF_COCOA_ENTER(env); |
|
1239 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1240 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1241 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
13233 | 1242 |
[nsWindow invalidateShadow]; |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1243 |
}]; |
12047 | 1244 |
|
1245 |
JNF_COCOA_EXIT(env); |
|
1246 |
} |
|
1247 |
||
1248 |
/* |
|
1249 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1250 |
* Method: nativeScreenOn_AppKitThread |
|
1251 |
* Signature: (J)I |
|
1252 |
*/ |
|
1253 |
JNIEXPORT jint JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeScreenOn_1AppKitThread |
|
1254 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
|
1255 |
{ |
|
1256 |
jint ret = 0; |
|
1257 |
||
1258 |
JNF_COCOA_ENTER(env); |
|
1259 |
AWT_ASSERT_APPKIT_THREAD; |
|
1260 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1261 |
NSWindow *nsWindow = OBJC(windowPtr); |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1262 |
NSDictionary *props = [[nsWindow screen] deviceDescription]; |
12047 | 1263 |
ret = [[props objectForKey:@"NSScreenNumber"] intValue]; |
1264 |
||
1265 |
JNF_COCOA_EXIT(env); |
|
1266 |
||
1267 |
return ret; |
|
1268 |
} |
|
1269 |
||
1270 |
/* |
|
1271 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1272 |
* Method: nativeSetNSWindowMinimizedIcon |
|
1273 |
* Signature: (JJ)V |
|
1274 |
*/ |
|
1275 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowMinimizedIcon |
|
1276 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jlong nsImagePtr) |
|
1277 |
{ |
|
1278 |
JNF_COCOA_ENTER(env); |
|
1279 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1280 |
NSWindow *nsWindow = OBJC(windowPtr); |
12047 | 1281 |
NSImage *image = OBJC(nsImagePtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1282 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1283 |
[nsWindow setMiniwindowImage:image]; |
12047 | 1284 |
}]; |
1285 |
||
1286 |
JNF_COCOA_EXIT(env); |
|
1287 |
} |
|
1288 |
||
1289 |
/* |
|
1290 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
1291 |
* Method: nativeSetNSWindowRepresentedFilename |
|
1292 |
* Signature: (JLjava/lang/String;)V |
|
1293 |
*/ |
|
1294 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetNSWindowRepresentedFilename |
|
1295 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jstring filename) |
|
1296 |
{ |
|
1297 |
JNF_COCOA_ENTER(env); |
|
1298 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1299 |
NSWindow *nsWindow = OBJC(windowPtr); |
12047 | 1300 |
NSURL *url = (filename == NULL) ? nil : [NSURL fileURLWithPath:JNFNormalizedNSStringForPath(env, filename)]; |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1301 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1302 |
[nsWindow setRepresentedURL:url]; |
12047 | 1303 |
}]; |
1304 |
||
1305 |
JNF_COCOA_EXIT(env); |
|
1306 |
} |
|
1307 |
||
1308 |
/* |
|
1309 |
* Class: sun_lwawt_macosx_CPlatformWindow |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1310 |
* Method: nativeGetTopmostPlatformWindowUnderMouse |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1311 |
* Signature: (J)V |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1312 |
*/ |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1313 |
JNIEXPORT jobject |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1314 |
JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeGetTopmostPlatformWindowUnderMouse |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1315 |
(JNIEnv *env, jclass clazz) |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1316 |
{ |
30924 | 1317 |
__block jobject topmostWindowUnderMouse = nil; |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1318 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1319 |
JNF_COCOA_ENTER(env); |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1320 |
|
30924 | 1321 |
[ThreadUtilities performOnMainThreadWaiting:YES block:^{ |
1322 |
AWTWindow *awtWindow = [AWTWindow getTopmostWindowUnderMouse]; |
|
1323 |
if (awtWindow != nil) { |
|
1324 |
topmostWindowUnderMouse = [awtWindow.javaPlatformWindow jObject]; |
|
1325 |
} |
|
1326 |
}]; |
|
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1327 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1328 |
JNF_COCOA_EXIT(env); |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1329 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1330 |
return topmostWindowUnderMouse; |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1331 |
} |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1332 |
|
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1333 |
/* |
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1334 |
* Class: sun_lwawt_macosx_CPlatformWindow |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1335 |
* Method: nativeSynthesizeMouseEnteredExitedEvents |
40993
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1336 |
* Signature: ()V |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1337 |
*/ |
40993
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1338 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSynthesizeMouseEnteredExitedEvents__ |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1339 |
(JNIEnv *env, jclass clazz) |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1340 |
{ |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1341 |
JNF_COCOA_ENTER(env); |
12640 | 1342 |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1343 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
13647
de61414bbcf2
7171045: [macosx] There are no enter or exit events reported against 8b39 for MouseEventsDuringDrag.
alexsch
parents:
13233
diff
changeset
|
1344 |
[AWTWindow synthesizeMouseEnteredExitedEventsForAllWindows]; |
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1345 |
}]; |
12640 | 1346 |
|
12535
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1347 |
JNF_COCOA_EXIT(env); |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1348 |
} |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1349 |
|
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1350 |
/* |
6d2ee83614e8
7154048: [macosx] At least drag twice, the toolbar can be dragged to the left side
alexsch
parents:
12402
diff
changeset
|
1351 |
* Class: sun_lwawt_macosx_CPlatformWindow |
40993
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1352 |
* Method: nativeSynthesizeMouseEnteredExitedEvents |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1353 |
* Signature: (JI)V |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1354 |
*/ |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1355 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSynthesizeMouseEnteredExitedEvents__JI |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1356 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jint eventType) |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1357 |
{ |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1358 |
JNF_COCOA_ENTER(env); |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1359 |
|
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1360 |
if (eventType == NSMouseEntered || eventType == NSMouseExited) { |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1361 |
NSWindow *nsWindow = OBJC(windowPtr); |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1362 |
|
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1363 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1364 |
[AWTWindow synthesizeMouseEnteredExitedEvents:nsWindow withType:eventType]; |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1365 |
}]; |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1366 |
} else { |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1367 |
[JNFException raise:env as:kIllegalArgumentException reason:"unknown event type"]; |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1368 |
} |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1369 |
|
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1370 |
JNF_COCOA_EXIT(env); |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1371 |
} |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1372 |
|
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1373 |
/* |
a24dc7d0dd28
8050478: [macosx] Cursor not updating correctly after closing a modal dialog
dmarkov
parents:
40446
diff
changeset
|
1374 |
* Class: sun_lwawt_macosx_CPlatformWindow |
12047 | 1375 |
* Method: _toggleFullScreenMode |
1376 |
* Signature: (J)V |
|
1377 |
*/ |
|
1378 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow__1toggleFullScreenMode |
|
1379 |
(JNIEnv *env, jobject peer, jlong windowPtr) |
|
1380 |
{ |
|
1381 |
JNF_COCOA_ENTER(env); |
|
1382 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1383 |
NSWindow *nsWindow = OBJC(windowPtr); |
12047 | 1384 |
SEL toggleFullScreenSelector = @selector(toggleFullScreen:); |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1385 |
if (![nsWindow respondsToSelector:toggleFullScreenSelector]) return; |
12047 | 1386 |
|
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1387 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1388 |
[nsWindow performSelector:toggleFullScreenSelector withObject:nil]; |
12047 | 1389 |
}]; |
1390 |
||
1391 |
JNF_COCOA_EXIT(env); |
|
1392 |
} |
|
1393 |
||
12640 | 1394 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetEnabled |
1395 |
(JNIEnv *env, jclass clazz, jlong windowPtr, jboolean isEnabled) |
|
1396 |
{ |
|
1397 |
JNF_COCOA_ENTER(env); |
|
1398 |
||
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1399 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1400 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
12648
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1401 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
00c38c393e11
7149062: [macosx] dock menu don't show available frames
anthony
parents:
12640
diff
changeset
|
1402 |
|
12640 | 1403 |
[window setEnabled: isEnabled]; |
1404 |
}]; |
|
1405 |
||
1406 |
JNF_COCOA_EXIT(env); |
|
1407 |
} |
|
1408 |
||
13009
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1409 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeDispose |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1410 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1411 |
{ |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1412 |
JNF_COCOA_ENTER(env); |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1413 |
|
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1414 |
NSWindow *nsWindow = OBJC(windowPtr); |
15322
3638f33225ec
7179050: [macosx] Make LWAWT be able to run on AppKit thread
serb
parents:
14753
diff
changeset
|
1415 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
13009
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1416 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1417 |
|
14311
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
1418 |
if ([AWTWindow lastKeyWindow] == window) { |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
1419 |
[AWTWindow setLastKeyWindow: nil]; |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
1420 |
} |
b2492ea8d08e
7124310: [macosx] "opposite" seems always null in focus events
leonidr
parents:
14165
diff
changeset
|
1421 |
|
13009
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1422 |
// AWTWindow holds a reference to the NSWindow in its nsWindow |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1423 |
// property. Unsetting the delegate allows it to be deallocated |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1424 |
// which releases the reference. This, in turn, allows the window |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1425 |
// itself be deallocated. |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1426 |
[nsWindow setDelegate: nil]; |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1427 |
|
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1428 |
[window release]; |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1429 |
}]; |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1430 |
|
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1431 |
JNF_COCOA_EXIT(env); |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1432 |
} |
f409e6ef0185
7174718: [macosx] Regression in 7u6 b12: PopupFactory leaks DefaultFrames.
anthony
parents:
12816
diff
changeset
|
1433 |
|
21282
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1434 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeEnterFullScreenMode |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1435 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1436 |
{ |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1437 |
JNF_COCOA_ENTER(env); |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1438 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1439 |
NSWindow *nsWindow = OBJC(windowPtr); |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1440 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1441 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1442 |
NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1443 |
CGDirectDisplayID aID = [screenID intValue]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1444 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1445 |
if (CGDisplayCapture(aID) == kCGErrorSuccess) { |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1446 |
// remove window decoration |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1447 |
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1448 |
[nsWindow setStyleMask:(styleMask & ~NSTitledWindowMask) | NSBorderlessWindowMask]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1449 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1450 |
int shieldLevel = CGShieldingWindowLevel(); |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1451 |
window.preFullScreenLevel = [nsWindow level]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1452 |
[nsWindow setLevel: shieldLevel]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1453 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1454 |
NSRect screenRect = [[nsWindow screen] frame]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1455 |
[nsWindow setFrame:screenRect display:YES]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1456 |
} else { |
21790
dae43c3c462d
8028512: [macosx] Crash in full screen api if incorrect display mode is used
serb
parents:
21788
diff
changeset
|
1457 |
[JNFException raise:[ThreadUtilities getJNIEnv] |
dae43c3c462d
8028512: [macosx] Crash in full screen api if incorrect display mode is used
serb
parents:
21788
diff
changeset
|
1458 |
as:kRuntimeException |
dae43c3c462d
8028512: [macosx] Crash in full screen api if incorrect display mode is used
serb
parents:
21788
diff
changeset
|
1459 |
reason:"Failed to enter full screen."]; |
21282
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1460 |
} |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1461 |
}]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1462 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1463 |
JNF_COCOA_EXIT(env); |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1464 |
} |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1465 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1466 |
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeExitFullScreenMode |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1467 |
(JNIEnv *env, jclass clazz, jlong windowPtr) |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1468 |
{ |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1469 |
JNF_COCOA_ENTER(env); |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1470 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1471 |
NSWindow *nsWindow = OBJC(windowPtr); |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1472 |
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){ |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1473 |
AWTWindow *window = (AWTWindow*)[nsWindow delegate]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1474 |
NSNumber* screenID = [AWTWindow getNSWindowDisplayID_AppKitThread: nsWindow]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1475 |
CGDirectDisplayID aID = [screenID intValue]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1476 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1477 |
if (CGDisplayRelease(aID) == kCGErrorSuccess) { |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1478 |
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1479 |
[nsWindow setStyleMask:styleMask]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1480 |
[nsWindow setLevel: window.preFullScreenLevel]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1481 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1482 |
// GraphicsDevice takes care of restoring pre full screen bounds |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1483 |
} else { |
21790
dae43c3c462d
8028512: [macosx] Crash in full screen api if incorrect display mode is used
serb
parents:
21788
diff
changeset
|
1484 |
[JNFException raise:[ThreadUtilities getJNIEnv] |
dae43c3c462d
8028512: [macosx] Crash in full screen api if incorrect display mode is used
serb
parents:
21788
diff
changeset
|
1485 |
as:kRuntimeException |
dae43c3c462d
8028512: [macosx] Crash in full screen api if incorrect display mode is used
serb
parents:
21788
diff
changeset
|
1486 |
reason:"Failed to exit full screen."]; |
21282
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1487 |
} |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1488 |
}]; |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1489 |
|
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1490 |
JNF_COCOA_EXIT(env); |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1491 |
} |
1bef38644939
8013581: [macosx] Key Bindings break with awt GraphicsEnvironment setFullScreenWindow
leonidr
parents:
21248
diff
changeset
|
1492 |