From 367b5fb1767e3b1f664bfbd0bb4418eeaed5b446 Mon Sep 17 00:00:00 2001 From: Brian Matzon Date: Wed, 11 Jan 2012 20:46:57 +0000 Subject: [PATCH] adding WS_MAXIMIZEBOX patch for windows and bumping native version --- src/java/org/lwjgl/WindowsSysImplementation.java | 2 +- src/java/org/lwjgl/opengl/WindowsDisplay.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/java/org/lwjgl/WindowsSysImplementation.java b/src/java/org/lwjgl/WindowsSysImplementation.java index 24727bc1..d50907dc 100644 --- a/src/java/org/lwjgl/WindowsSysImplementation.java +++ b/src/java/org/lwjgl/WindowsSysImplementation.java @@ -46,7 +46,7 @@ import org.lwjgl.opengl.Display; * $Id$ */ final class WindowsSysImplementation extends DefaultSysImplementation { - private static final int JNI_VERSION = 23; + private static final int JNI_VERSION = 24; static { Sys.initialize(); diff --git a/src/java/org/lwjgl/opengl/WindowsDisplay.java b/src/java/org/lwjgl/opengl/WindowsDisplay.java index 6aab353a..0da6c6ed 100644 --- a/src/java/org/lwjgl/opengl/WindowsDisplay.java +++ b/src/java/org/lwjgl/opengl/WindowsDisplay.java @@ -143,6 +143,7 @@ final class WindowsDisplay implements DisplayImplementation { private static final int GWL_EXSTYLE = -20; private static final int WS_THICKFRAME = 0x00040000; + private static final int WS_MAXIMIZEBOX = 0x00010000; private static final int HTCLIENT = 0x01; @@ -858,6 +859,8 @@ final class WindowsDisplay implements DisplayImplementation { switch ((int)wParam) { case SIZE_RESTORED: case SIZE_MAXIMIZED: + resized = true; + updateWidthAndHeight(); setMinimized(false); break; case SIZE_MINIMIZED: @@ -1011,9 +1014,9 @@ final class WindowsDisplay implements DisplayImplementation { // update frame style if(resizable) { - setWindowLongPtr(hwnd, GWL_STYLE, style |= WS_THICKFRAME); + setWindowLongPtr(hwnd, GWL_STYLE, style |= (WS_THICKFRAME | WS_MAXIMIZEBOX)); } else { - setWindowLongPtr(hwnd, GWL_STYLE, style &= ~WS_THICKFRAME); + setWindowLongPtr(hwnd, GWL_STYLE, style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX)); } // from the existing client rect, determine the new window rect