class: WinWorkstation
authorStefan Vogel <sv@exept.de>
Thu, 05 Jun 2014 11:56:00 +0200
changeset 6494 e0f0e0570c4a
parent 6493 7785d3d8458b
child 6495 17a64286fe5e
class: WinWorkstation fix fullscreen for dual screen
WinWorkstation.st
--- a/WinWorkstation.st	Thu Jun 05 08:13:43 2014 +0200
+++ b/WinWorkstation.st	Thu Jun 05 11:56:00 2014 +0200
@@ -742,6 +742,8 @@
 	short           maxWidth;
 	short           minHeight;
 	short           maxHeight;
+	short           currentMonitorWidth;
+	short           currentMonitorHeight;
 	short           bw;
 	unsigned char   iconified;
 	unsigned char   viewGravity;
@@ -863,9 +865,6 @@
 #define GetWindow_paintInfoPtr(__hWnd__) \
 	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->paintInfo) : 0)
 
-#define GetWindow_sizeInfoPtr(__hWnd__) \
-	(GETLOCALWINDOWINFOPTR(__hWnd__) ? &(GETLOCALWINDOWINFOPTR(__hWnd__)->sizeInfo) : 0)
-
 #define SetWindow_flag(__hWnd__, __flag__) \
 	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->flag = __flag__) : 0)
 
@@ -875,6 +874,13 @@
 #define GetWindow_eventMask(__hWnd__) \
 	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->eventMask) : 0)
 
+#define SetWindow_currentMonitorWidth(__hWnd__, __width__) \
+	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->currentMonitorWidth = __width__) : 0)
+
+#define SetWindow_currentMonitorHeight(__hWnd__, __height__) \
+	(GETLOCALWINDOWINFOPTR(__hWnd__) ? (GETLOCALWINDOWINFOPTR(__hWnd__)->currentMonitorHeight = __height__) : 0)
+
+
 struct queuedEvent {
 	struct queuedEvent     *ev_next;
 	int                     count;
@@ -2780,9 +2786,7 @@
 	    {
 		int minW, maxW;
 		localWindowInfo *lI;
-		LPMINMAXINFO lpmmi;
-
-		lpmmi = (LPMINMAXINFO) lParam;
+		LPMINMAXINFO lpmmi = (LPMINMAXINFO) lParam;
 
 		EVENT_PRINTF2(("WM_GETMINMAXINFO handle=%x got min: %d/%d\n",
 			    hWnd,
@@ -2791,10 +2795,16 @@
 
 		lI = GETLOCALWINDOWINFOPTR(hWnd);
 		if (lI && (lI->minWidth) && (lI->maxWidth)) {
-		  lpmmi->ptMaxSize.x = lI->maxWidth;
-		  lpmmi->ptMaxSize.y = lI->maxHeight;
-		  lpmmi->ptMaxTrackSize.x = lI->maxWidth;
-		  lpmmi->ptMaxTrackSize.y = lI->maxHeight;
+		  lpmmi->ptMaxPosition.x = 0;
+		  lpmmi->ptMaxPosition.y = 0;
+		  lpmmi->ptMaxSize.x = lI->currentMonitorWidth;
+		  lpmmi->ptMaxSize.y = lI->currentMonitorHeight;
+#define MIN(a, b) (a < b ? a : b)
+		  lpmmi->ptMaxSize.x = MIN(GetSystemMetrics(SM_CXMAXIMIZED), lI->maxWidth);
+		  lpmmi->ptMaxSize.y = MIN(GetSystemMetrics(SM_CYMAXIMIZED), lI->maxHeight);
+
+		  lpmmi->ptMaxTrackSize.x = lI->maxWidth == 0 ? GetSystemMetrics(SM_CXMAXTRACK) : lI->maxWidth;
+		  lpmmi->ptMaxTrackSize.y = lI->maxHeight == 0 ? GetSystemMetrics(SM_CYMAXTRACK) : lI->maxHeight;
 		  lpmmi->ptMinTrackSize.x = lI->minWidth;
 		  lpmmi->ptMinTrackSize.y = lI->minHeight;
 
@@ -2802,8 +2812,8 @@
 				  hWnd,
 				  lI->minWidth, lI->minHeight,
 				  lI->maxWidth, lI->maxHeight));
-		}
-		*pDefault = 0;
+		  *pDefault = 0;
+		}
 	    }
 	    break;
 
@@ -19339,11 +19349,11 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.483 2014-05-28 18:06:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.484 2014-06-05 09:56:00 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.483 2014-05-28 18:06:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.484 2014-06-05 09:56:00 stefan Exp $'
 ! !