Added setLocation support for linux
This commit is contained in:
parent
da867ff28a
commit
af66408d3d
|
@ -11,6 +11,8 @@ extern "C" {
|
||||||
/* Inaccessible static: initial_mode */
|
/* Inaccessible static: initial_mode */
|
||||||
/* Inaccessible static: timeNow */
|
/* Inaccessible static: timeNow */
|
||||||
/* Inaccessible static: timeThen */
|
/* Inaccessible static: timeThen */
|
||||||
|
/* Inaccessible static: x */
|
||||||
|
/* Inaccessible static: y */
|
||||||
/* Inaccessible static: title */
|
/* Inaccessible static: title */
|
||||||
/* Inaccessible static: fullscreen */
|
/* Inaccessible static: fullscreen */
|
||||||
/* Inaccessible static: vsync */
|
/* Inaccessible static: vsync */
|
||||||
|
@ -27,10 +29,10 @@ JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_Display_nGetAvailableDispla
|
||||||
/*
|
/*
|
||||||
* Class: org_lwjgl_opengl_Display
|
* Class: org_lwjgl_opengl_Display
|
||||||
* Method: nCreateWindow
|
* Method: nCreateWindow
|
||||||
* Signature: (Lorg/lwjgl/opengl/DisplayMode;Z)V
|
* Signature: (Lorg/lwjgl/opengl/DisplayMode;ZII)V
|
||||||
*/
|
*/
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nCreateWindow
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nCreateWindow
|
||||||
(JNIEnv *, jclass, jobject, jboolean);
|
(JNIEnv *, jclass, jobject, jboolean, jint, jint);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Class: org_lwjgl_opengl_Display
|
* Class: org_lwjgl_opengl_Display
|
||||||
|
@ -184,6 +186,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nUpdate
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nSetVSyncEnabled
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nSetVSyncEnabled
|
||||||
(JNIEnv *, jclass, jboolean);
|
(JNIEnv *, jclass, jboolean);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_lwjgl_opengl_Display
|
||||||
|
* Method: nReshape
|
||||||
|
* Signature: (IIII)V
|
||||||
|
*/
|
||||||
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nReshape
|
||||||
|
(JNIEnv *, jclass, jint, jint, jint, jint);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -343,7 +343,11 @@ static bool isNetWMFullscreenSupported() {
|
||||||
return supported;
|
return supported;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool createWindow(JNIEnv* env, int width, int height) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nReshape(JNIEnv *env, jclass clazz, jint x, jint y, jint width, jint height) {
|
||||||
|
XMoveWindow(getDisplay(), getCurrentWindow(), x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool createWindow(JNIEnv* env, int x, int y, int width, int height) {
|
||||||
bool undecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated");
|
bool undecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated");
|
||||||
dirty = true;
|
dirty = true;
|
||||||
focused = true;
|
focused = true;
|
||||||
|
@ -370,7 +374,7 @@ static bool createWindow(JNIEnv* env, int width, int height) {
|
||||||
attribmask |= CWOverrideRedirect;
|
attribmask |= CWOverrideRedirect;
|
||||||
attribs.override_redirect = True;
|
attribs.override_redirect = True;
|
||||||
}
|
}
|
||||||
win = XCreateWindow(getDisplay(), root_win, 0, 0, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs);
|
win = XCreateWindow(getDisplay(), root_win, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs);
|
||||||
if (!checkXError(env)) {
|
if (!checkXError(env)) {
|
||||||
XFreeColormap(getDisplay(), cmap);
|
XFreeColormap(getDisplay(), cmap);
|
||||||
return false;
|
return false;
|
||||||
|
@ -706,7 +710,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_destroyContext(JNIEnv *env,
|
||||||
decDisplay();
|
decDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nCreateWindow(JNIEnv *env, jclass clazz, jobject mode, jboolean fullscreen) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nCreateWindow(JNIEnv *env, jclass clazz, jobject mode, jboolean fullscreen, int x, int y) {
|
||||||
bool current_fullscreen = fullscreen == JNI_TRUE;
|
bool current_fullscreen = fullscreen == JNI_TRUE;
|
||||||
if (current_fullscreen) {
|
if (current_fullscreen) {
|
||||||
if (getCurrentDisplayModeExtension() == XRANDR && isNetWMFullscreenSupported())
|
if (getCurrentDisplayModeExtension() == XRANDR && isNetWMFullscreenSupported())
|
||||||
|
@ -720,7 +724,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nCreateWindow(JNIEnv *env,
|
||||||
jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
|
jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I");
|
||||||
int width = (*env)->GetIntField(env, mode, fid_width);
|
int width = (*env)->GetIntField(env, mode, fid_width);
|
||||||
int height = (*env)->GetIntField(env, mode, fid_height);
|
int height = (*env)->GetIntField(env, mode, fid_height);
|
||||||
bool window_created = createWindow(env, width, height);
|
bool window_created = createWindow(env, x, y, width, height);
|
||||||
if (!window_created) {
|
if (!window_created) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue