|
From: Elias N. <eli...@us...> - 2004-08-21 10:22:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9259/linux Modified Files: org_lwjgl_input_Keyboard.cpp org_lwjgl_opengl_Display.cpp Log Message: Linux: only grab the keyboard when in fullscreen mode. Remove the alt-tab hack Index: org_lwjgl_opengl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_opengl_Display.cpp 12 Aug 2004 15:22:47 -0000 1.17 +++ org_lwjgl_opengl_Display.cpp 21 Aug 2004 10:22:23 -0000 1.18 @@ -187,6 +187,9 @@ input_released = true; setRepeatMode(AutoRepeatModeDefault); updateInputGrab(); +/* if (current_fullscreen) { + XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); + }*/ return true; } @@ -323,7 +326,8 @@ attribs.colormap = cmap; attribs.event_mask = ExposureMask | FocusChangeMask | VisibilityChangeMask| StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask; attribs.background_pixel = 0xFF000000; - attribmask = CWColormap | CWBackPixel | CWEventMask; + attribs.win_gravity = NorthWestGravity; + attribmask = CWColormap | CWBackPixel | CWEventMask | CWWinGravity; if (current_fullscreen || undecorated) { attribmask |= CWOverrideRedirect; attribs.override_redirect = True; @@ -345,6 +349,11 @@ XFree(size_hints); delete_atom = XInternAtom(getDisplay(), "WM_DELETE_WINDOW", False); XSetWMProtocols(getDisplay(), win, &delete_atom, 1); +/* if (current_fullscreen) { + Atom fullscreen_atom = XInternAtom(getDisplay(), "_NET_WM_STATE_FULLSCREEN", False); + XChangeProperty(getDisplay(), getCurrentWindow(), XInternAtom(getDisplay(), "_NET_WM_STATE", False), + XInternAtom(getDisplay(), "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1); + }*/ XMapRaised(getDisplay(), win); waitMapped(win); XClearWindow(getDisplay(), win); @@ -368,11 +377,6 @@ return current_height; } -/* - * Class: org_lwjgl_Window - * Method: nUpdate - * Signature: ()V - */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Display_nUpdate (JNIEnv *env, jclass clazz) { Index: org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- org_lwjgl_input_Keyboard.cpp 12 Jun 2004 20:28:32 -0000 1.35 +++ org_lwjgl_input_Keyboard.cpp 21 Aug 2004 10:22:23 -0000 1.36 @@ -80,18 +80,13 @@ void updateKeyboardGrab(void) { if (!created) return; - if (isFullscreen() || shouldGrab()) { + if (isFullscreen()/* || shouldGrab()*/) { grabKeyboard(); } else { ungrabKeyboard(); } } -/* - * Class: org_lwjgl_input_Keyboard - * Method: nCreate - * Signature: ()Z - */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { @@ -128,11 +123,6 @@ updateKeyboardGrab(); } -/* - * Class: org_lwjgl_input_Keyboard - * Method: nDestroy - * Signature: ()V - */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nDestroy (JNIEnv * env, jclass clazz) { @@ -199,17 +189,6 @@ unsigned char keycode = getKeycode(event); unsigned char state = eventState(event); key_buf[keycode] = state; - if (key_buf[org_lwjgl_input_Keyboard_KEY_LMENU] == 1 || - key_buf[org_lwjgl_input_Keyboard_KEY_RMENU] == 1) { - if (key_buf[org_lwjgl_input_Keyboard_KEY_TAB] == 1) { - if (releaseInput()) { - key_buf[org_lwjgl_input_Keyboard_KEY_RMENU] = 0; - key_buf[org_lwjgl_input_Keyboard_KEY_LMENU] = 0; - key_buf[org_lwjgl_input_Keyboard_KEY_TAB] = 0; - return; - } - } - } if (buffer_enabled) bufferEvent(event); } |