[java-atk-wrapper] Fix regression - confilct with GTK look and feel



commit 6394303a42a4b55d33bb4210cf2e3afff16a72f9
Author: Ke Wang <ke wang sun com>
Date:   Fri Feb 26 11:37:32 2010 +0800

    Fix regression - confilct with GTK look and feel

 jni/src/AtkWrapper.c                               |    7 +++++--
 wrapper/org/GNOME/Accessibility/AtkWrapper.java.in |    9 +++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index 04122ae..3dcee94 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -179,12 +179,15 @@ JNIEXPORT void JNICALL Java_org_GNOME_Accessibility_AtkWrapper_initNativeLibrary
 
 	key_dispatch_mutex = g_mutex_new();
 	key_dispatch_cond = g_cond_new();
-
-	GMainLoop *main_loop = g_main_loop_new( NULL, FALSE );
 	
 	// Dummy idle function for jaw_idle_dispatch to get
 	// the address of gdk_threads_dispatch
 	gdk_threads_add_idle(jaw_dummy_idle_func, NULL);
+}
+
+JNIEXPORT void JNICALL Java_org_GNOME_Accessibility_AtkWrapper_loadAtkBridge(JNIEnv *jniEnv, jclass jClass) {
+	GMainLoop *main_loop = g_main_loop_new( NULL, FALSE );
+	
 	g_idle_add(jaw_load_atk_bridge, NULL);
 
 	// We need to wait for the completion of the loading of ATK Bridge
diff --git a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
index d82830b..34132cb 100644
--- a/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
+++ b/wrapper/org/GNOME/Accessibility/AtkWrapper.java.in
@@ -40,6 +40,11 @@ public class AtkWrapper {
 					break;
 				}
 			}
+
+			if (accessibilityEnabled) {
+				System.loadLibrary("atk-wrapper");
+				AtkWrapper.initNativeLibrary();
+			}
 			
 		} catch (Exception e) {
 			e.printStackTrace();
@@ -138,8 +143,7 @@ public class AtkWrapper {
 			if (firstEvent && accessibilityEnabled) {
 				firstEvent = false;
 				try {
-					System.loadLibrary("atk-wrapper");
-					AtkWrapper.initNativeLibrary();
+					AtkWrapper.loadAtkBridge();
 				} catch (Exception ex) {
 					ex.printStackTrace();
 				}
@@ -494,6 +498,7 @@ public class AtkWrapper {
 	}
 
 	public native static void initNativeLibrary();
+	public native static void loadAtkBridge();
 
 	public native static void focusNotify(javax.accessibility.AccessibleContext ac);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]