Linux: Removed change set code again
This commit is contained in:
parent
6ac8101392
commit
261d453a3e
|
@ -404,23 +404,13 @@ final class LinuxDisplay implements DisplayImplementation {
|
||||||
try {
|
try {
|
||||||
incDisplay();
|
incDisplay();
|
||||||
try {
|
try {
|
||||||
if (parent != null && !hasXFixes(getDisplay(), 1))
|
|
||||||
throw new LWJGLException("No XFixes extension available");
|
|
||||||
ByteBuffer handle = peer_info.lockAndGetHandle();
|
ByteBuffer handle = peer_info.lockAndGetHandle();
|
||||||
try {
|
try {
|
||||||
current_window_mode = getWindowMode(fullscreen);
|
current_window_mode = getWindowMode(fullscreen);
|
||||||
boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || current_window_mode != WINDOWED;
|
boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || current_window_mode != WINDOWED;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
long root_window = getRootWindow(getDisplay(), getDefaultScreen());
|
long parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen());
|
||||||
current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, root_window);
|
current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window);
|
||||||
if (parent != null) {
|
|
||||||
parent.addFocusListener(focus_listener);
|
|
||||||
parent_focused = parent.isFocusOwner();
|
|
||||||
parent_focus_changed = true;
|
|
||||||
parent_window = getHandle(parent);
|
|
||||||
changeSaveSet(getDisplay(), current_window, SetModeInsert, SaveSetRoot, SaveSetUnmap);
|
|
||||||
reparentWindow(getDisplay(), current_window, parent_window, x, y);
|
|
||||||
}
|
|
||||||
mapRaised(getDisplay(), current_window);
|
mapRaised(getDisplay(), current_window);
|
||||||
xembedded = parent != null && isAncestorXEmbedded(parent_window);
|
xembedded = parent != null && isAncestorXEmbedded(parent_window);
|
||||||
blank_cursor = createBlankCursor();
|
blank_cursor = createBlankCursor();
|
||||||
|
@ -434,6 +424,11 @@ final class LinuxDisplay implements DisplayImplementation {
|
||||||
grab = false;
|
grab = false;
|
||||||
minimized = false;
|
minimized = false;
|
||||||
dirty = true;
|
dirty = true;
|
||||||
|
if (parent != null) {
|
||||||
|
parent.addFocusListener(focus_listener);
|
||||||
|
parent_focused = parent.isFocusOwner();
|
||||||
|
parent_focus_changed = true;
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
peer_info.unlock();
|
peer_info.unlock();
|
||||||
}
|
}
|
||||||
|
@ -450,9 +445,7 @@ final class LinuxDisplay implements DisplayImplementation {
|
||||||
private static native boolean hasProperty(long display, long window, long property);
|
private static native boolean hasProperty(long display, long window, long property);
|
||||||
private static native long getParentWindow(long display, long window) throws LWJGLException;
|
private static native long getParentWindow(long display, long window) throws LWJGLException;
|
||||||
private static native void mapRaised(long display, long window);
|
private static native void mapRaised(long display, long window);
|
||||||
private static native boolean hasXFixes(long display, int major);
|
|
||||||
private static native void reparentWindow(long display, long window, long parent, int x, int y);
|
private static native void reparentWindow(long display, long window, long parent, int x, int y);
|
||||||
private static native void changeSaveSet(long display, long window, int mode, int target, int map);
|
|
||||||
|
|
||||||
private boolean isAncestorXEmbedded(long window) throws LWJGLException {
|
private boolean isAncestorXEmbedded(long window) throws LWJGLException {
|
||||||
long xembed_atom = internAtom("_XEMBED_INFO", true);
|
long xembed_atom = internAtom("_XEMBED_INFO", true);
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xutil.h>
|
#include <X11/Xutil.h>
|
||||||
#include <X11/extensions/xf86vmode.h>
|
#include <X11/extensions/xf86vmode.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -330,29 +329,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_reparentWindow(JNIEnv
|
||||||
XReparentWindow(disp, window, parent, x, y);
|
XReparentWindow(disp, window, parent, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_hasXFixes(JNIEnv *env, jclass unused, jlong display, jint major_requested) {
|
|
||||||
Display *disp = (Display *)(intptr_t)display;
|
|
||||||
int event, error;
|
|
||||||
if (!XFixesQueryExtension(disp, &event, &error))
|
|
||||||
return JNI_FALSE;
|
|
||||||
int major, minor;
|
|
||||||
if (!XFixesQueryVersion(disp, &major, &minor))
|
|
||||||
return JNI_FALSE;
|
|
||||||
return major >= major_requested ? JNI_TRUE : JNI_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_mapRaised(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
|
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_mapRaised(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
|
||||||
Display *disp = (Display *)(intptr_t)display;
|
Display *disp = (Display *)(intptr_t)display;
|
||||||
Window window = (Window)window_ptr;
|
Window window = (Window)window_ptr;
|
||||||
XMapRaised(disp, window);
|
XMapRaised(disp, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_changeSaveSet(JNIEnv *env, jclass unused, jlong display, jlong window_ptr, jint mode, jint target, jint map) {
|
|
||||||
Display *disp = (Display *)(intptr_t)display;
|
|
||||||
Window window = (Window)window_ptr;
|
|
||||||
XFixesChangeSaveSet(disp, window, mode, target, map);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getParentWindow(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
|
JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getParentWindow(JNIEnv *env, jclass unused, jlong display, jlong window_ptr) {
|
||||||
Display *disp = (Display *)(intptr_t)display;
|
Display *disp = (Display *)(intptr_t)display;
|
||||||
Window window = (Window)window_ptr;
|
Window window = (Window)window_ptr;
|
||||||
|
|
Loading…
Reference in New Issue