Posted By:
nicolas_cochin
Posted On:
Monday, March 6, 2006 12:32 AM
Hi, I'd like to get the window ID of a frame. I'm runing java on Linux. I've seen on a web site that I can get it from the JAWT_X11DrawingSurfaceInfo. So I did this to get the JAWT_X11DrawingSurfaceInfo : JNIEXPORT jlong JNICALL Java_MyFrame_getWindowID(JNIEnv *env, jclass cls, jobject comp) { JAWT awt; JAWT_DrawingSurface *ds; JAWT_DrawingSurfaceInfo *dsi; JAWT_X11DrawingSurfaceInfo *dsi_X11; jint lock; jlong windowID; jboolean result; /* get the awt */ awt.version = JAWT_VERSION_1_3; result = JAWT_GetAWT(env, &awt); assert(result != JNI_F
More>>
Hi,
I'd like to get the window ID of a frame.
I'm runing java on Linux.
I've seen on a web site that I can get it from the JAWT_X11DrawingSurfaceInfo.
So I did this to get the JAWT_X11DrawingSurfaceInfo :
JNIEXPORT jlong JNICALL Java_MyFrame_getWindowID(JNIEnv *env, jclass cls, jobject comp) {
JAWT awt;
JAWT_DrawingSurface *ds;
JAWT_DrawingSurfaceInfo *dsi;
JAWT_X11DrawingSurfaceInfo *dsi_X11;
jint lock;
jlong windowID;
jboolean result;
/* get the awt */
awt.version = JAWT_VERSION_1_3;
result = JAWT_GetAWT(env, &awt);
assert(result != JNI_FALSE);
/* get the drawing surface */
ds = awt.GetDrawingSurface(env, comp);
assert(ds != NULL);
/* lock the drawing surface */
lock = ds->Lock(ds);
assert((lock & JAWT_LOCK_ERROR) == 0);
/* get the drawing surface info */
dsi = ds->GetDrawingSurfaceInfo(ds);
/* get the X11 drawing surface info */
dsi_X11 = (JAWT_X11DrawingSurfaceInfo*)dsi->platformInfo;
windowID = (jlong)dsi_X11->visualID;
/* resource cleanup */
ds->FreeDrawingSurfaceInfo(dsi);
ds->Unlock(ds);
awt.FreeDrawingSurface(ds);
return windowID;
}
My pb is that I can't lock my frame. It always crash here : assert((lock & JAWT_LOCK_ERROR) == 0);
I'm completly lost at the moment, any help will be welcome.
Thank you for your answers.
Nicolas
<<Less