2004/01/20 20:33:47
[org.ibex.core.git] / src / org / xwt / plat / Win32.cc
index 248d555..1b3ccea 100644 (file)
@@ -146,6 +146,12 @@ static unsigned char hand_cursor_and[32 * 4] = {
   0xFF, 0xFF, 0xFF, 0xFF
 };
 
+void org::xwt::plat::Win32::natPreInit() {
+    if (org::xwt::util::Log::verbose) {
+        AllocConsole();
+        freopen("CONOUT$", "w+t", stderr);
+    }
+}
 
 void org::xwt::plat::Win32::natInit() {
 
@@ -618,6 +624,7 @@ jint org::xwt::plat::Win32$Win32Surface::WndProc(jint _hwnd, jint _iMsg, jint _w
 
     int oldmousex, oldmousey;
     MINMAXINFO* mmi;
+    int resizable;
     POINT point;
     HWND hwnd2;
     RECT rect, rect2;
@@ -738,8 +745,9 @@ jint org::xwt::plat::Win32$Win32Surface::WndProc(jint _hwnd, jint _iMsg, jint _w
         mmi = (MINMAXINFO*)lParam;
         mmi->ptMinTrackSize.x = ((uint32_t)root->minwidth) + addwidth;
         mmi->ptMinTrackSize.y = ((uint32_t)root->minheight) + addheight;
-        mmi->ptMaxTrackSize.x = org::xwt::plat::Win32::getScreenWidth();
-        mmi->ptMaxTrackSize.y = org::xwt::plat::Win32::getScreenHeight();
+        resizable = !((root->minwidth == root->maxwidth) && (root->minheight == root->maxheight));
+        mmi->ptMaxTrackSize.x = resizable ? org::xwt::plat::Win32::getScreenWidth() : mmi->ptMinTrackSize.x;
+        mmi->ptMaxTrackSize.y = resizable ? org::xwt::plat::Win32::getScreenHeight() : mmi->ptMinTrackSize.y;
         return 0;
         
     case WM_PAINT: