From e686334d1452fc266a78d1039484353ed4c4f09e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 10 Sep 2004 14:09:33 +0000 Subject: [PATCH] Improved _NET_WM_STATE_FULLSCREEN support for older kde window managers --- src/native/linux/org_lwjgl_opengl_Display.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/native/linux/org_lwjgl_opengl_Display.c b/src/native/linux/org_lwjgl_opengl_Display.c index 3686b5f5..ec0537e2 100644 --- a/src/native/linux/org_lwjgl_opengl_Display.c +++ b/src/native/linux/org_lwjgl_opengl_Display.c @@ -191,6 +191,14 @@ static void setRepeatMode(int mode) { XCloseDisplay(disp); } +static void setDecorations(int dec) { + Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False); + MotifWmHints motif_hints; + motif_hints.flags = MWM_HINTS_DECORATIONS; + motif_hints.decorations = dec; + XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); +} + bool releaseInput(void) { if (isLegacyFullscreen() || input_released) return false; @@ -369,13 +377,9 @@ static bool createWindow(JNIEnv* env, int width, int height) { } printfDebug("Created window\n"); current_win = win; - if (undecorated && current_window_mode == WINDOWED) { + if (current_window_mode != WINDOWED || undecorated) { // Use Motif decoration hint property and hope the window manager respects them - Atom motif_hints_atom = XInternAtom(getDisplay(), "_MOTIF_WM_HINTS", False); - MotifWmHints motif_hints; - motif_hints.flags = MWM_HINTS_DECORATIONS; - motif_hints.decorations = 0; - XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); + setDecorations(0); } XSizeHints * size_hints = XAllocSizeHints(); size_hints->flags = PMinSize | PMaxSize;