112 static void displaycb_handle |
113 static void displaycb_handle |
113 (CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo) |
114 (CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo) |
114 { |
115 { |
115 if (flags == kCGDisplayBeginConfigurationFlag) return; |
116 if (flags == kCGDisplayBeginConfigurationFlag) return; |
116 |
117 |
117 JNFPerformEnvBlock(JNFThreadDetachImmediately, ^(JNIEnv *env) { |
118 [ThreadUtilities performOnMainThreadWaiting:NO block:^() { |
118 JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)userInfo; |
|
119 |
119 |
120 jobject graphicsEnv = [wrapper jObjectWithEnv:env]; |
120 JNFPerformEnvBlock(JNFThreadDetachImmediately, ^(JNIEnv *env) { |
121 if (graphicsEnv == NULL) return; // ref already GC'd |
121 JNFWeakJObjectWrapper *wrapper = (JNFWeakJObjectWrapper *)userInfo; |
122 static JNF_CLASS_CACHE(jc_CGraphicsEnvironment, "sun/awt/CGraphicsEnvironment"); |
122 |
123 static JNF_MEMBER_CACHE(jm_displayReconfiguration, jc_CGraphicsEnvironment, "_displayReconfiguration", "(IZ)V"); |
123 jobject graphicsEnv = [wrapper jObjectWithEnv:env]; |
124 JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration, |
124 if (graphicsEnv == NULL) return; // ref already GC'd |
125 (jint) display, |
125 static JNF_CLASS_CACHE(jc_CGraphicsEnvironment, "sun/awt/CGraphicsEnvironment"); |
126 (jboolean) flags & kCGDisplayRemoveFlag); |
126 static JNF_MEMBER_CACHE(jm_displayReconfiguration, |
127 }); |
127 jc_CGraphicsEnvironment, "_displayReconfiguration","(IZ)V"); |
|
128 JNFCallVoidMethod(env, graphicsEnv, jm_displayReconfiguration, |
|
129 (jint) display, (jboolean) flags & kCGDisplayRemoveFlag); |
|
130 }); |
|
131 }]; |
128 } |
132 } |
129 |
133 |
130 /* |
134 /* |
131 * Class: sun_awt_CGraphicsEnvironment |
135 * Class: sun_awt_CGraphicsEnvironment |
132 * Method: registerDisplayReconfiguration |
136 * Method: registerDisplayReconfiguration |