2004/01/17 07:30:32
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:44 +0000 (07:44 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:44:44 +0000 (07:44 +0000)
darcs-hash:20040130074444-2ba56-5b4f557968736b720e47e63465e361e2d888a7ac.gz

src/org/xwt/plat/Linux.cc
src/org/xwt/plat/Win32.cc
src/org/xwt/plat/X11.java

index 7b82e2b..2f7ca8c 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <org/xwt/plat/Linux.h>
 
-void org::xwt::plat::X11$X11PixelBuffer::fixEnvironment() {
+void org::xwt::plat::Linux::fixEnvironment() {
   // see http://lists.debian.org/debian-glibc/2003/debian-glibc-200311/msg00647.html
   setenv("LD_ASSUME_KERNEL", "2.4.1", 0);
 }
index 248d555..c278998 100644 (file)
@@ -618,6 +618,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 +739,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: 
index d845f25..d84aa85 100644 (file)
@@ -77,7 +77,9 @@ public class X11 extends POSIX {
         public native void setLimits(int minw, int minh, int maxw, int maxh);
         public native void blit(PixelBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2);
         public native void dispatchEvent(gnu.gcj.RawData ev);
-
+        public void setMinimumSize(int minx, int miny, boolean resizable) {
+            setLimits(minx, miny, resizable ? Short.MAX_VALUE : minx, resizable ? Short.MAX_VALUE : miny);
+        }
         public X11Surface(Box root, boolean framed) {
             super(root);
             this.framed = framed;