Linux: Added support for LWJGL_DISABLE_NETWM environment which will override the NetWM detection
This commit is contained in:
parent
d26dca6029
commit
274abbf856
|
@ -333,12 +333,19 @@ static void destroyWindow(JNIEnv *env) {
|
||||||
setRepeatMode(env, AutoRepeatModeDefault);
|
setRepeatMode(env, AutoRepeatModeDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isNetWMForceDisabled() {
|
||||||
|
char *supported_env = getenv("LWJGL_DISABLE_NETWM");
|
||||||
|
return supported_env != NULL;
|
||||||
|
}
|
||||||
|
|
||||||
static bool isNetWMFullscreenSupported(JNIEnv *env) {
|
static bool isNetWMFullscreenSupported(JNIEnv *env) {
|
||||||
unsigned long nitems;
|
unsigned long nitems;
|
||||||
Atom actual_type;
|
Atom actual_type;
|
||||||
int actual_format;
|
int actual_format;
|
||||||
unsigned long bytes_after;
|
unsigned long bytes_after;
|
||||||
Atom *supported_list;
|
Atom *supported_list;
|
||||||
|
if (isNetWMForceDisabled())
|
||||||
|
return false;
|
||||||
Atom netwm_supported_atom = XInternAtom(getDisplay(), "_NET_SUPPORTED", False);
|
Atom netwm_supported_atom = XInternAtom(getDisplay(), "_NET_SUPPORTED", False);
|
||||||
int result = XGetWindowProperty(getDisplay(), RootWindow(getDisplay(), getCurrentScreen()), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list);
|
int result = XGetWindowProperty(getDisplay(), RootWindow(getDisplay(), getCurrentScreen()), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list);
|
||||||
if (result != Success) {
|
if (result != Success) {
|
||||||
|
|
Loading…
Reference in New Issue