Do not set maxExtent (to the Screen size) in StandartSystemView.
authorStefan Vogel <sv@exept.de>
Sat, 03 Jul 2004 19:12:03 +0200
changeset 4197 1984b2ba83de
parent 4196 ceb52e442de3
child 4198 bb05c0ae2595
Do not set maxExtent (to the Screen size) in StandartSystemView. At least KDE window manager will not show the maximize button if maxExtent is set!
ModalBox.st
StandardSystemView.st
--- a/ModalBox.st	Sat Jul 03 19:04:22 2004 +0200
+++ b/ModalBox.st	Sat Jul 03 19:12:03 2004 +0200
@@ -409,22 +409,23 @@
 resize
     "resize myself to make everything visible"
 
-    |newExtent|
+    |newExtent maxExtent|
 
     newExtent := self preferredExtent.
-    newExtent := newExtent min:(self maxExtent).
-    newExtent = self extent ifTrue:[^ self].
-
-    (shown and:[shadowView notNil]) ifTrue:[
-        shadowView unmap.
-        self extent:newExtent.
-        shadowView realize.
-        self raise
-    ] ifFalse:[
-        self extent:newExtent.
+    maxExtent := self maxExtent.
+    maxExtent notNil ifTrue:[
+        newExtent := newExtent min:maxExtent.
     ].
-
-    "Modified: 3.5.1996 / 23:48:12 / stefan"
+    newExtent ~= self extent ifTrue:[
+        (shown and:[shadowView notNil]) ifTrue:[
+            shadowView unmap.
+            self extent:newExtent.
+            shadowView realize.
+            self raise
+        ] ifFalse:[
+            self extent:newExtent.
+        ].
+    ].
 !
 
 resizeUnderPointer
@@ -910,7 +911,7 @@
 !ModalBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.87 2004-05-17 16:50:36 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ModalBox.st,v 1.88 2004-07-03 17:12:03 stefan Exp $'
 ! !
 
 ModalBox initialize!
--- a/StandardSystemView.st	Sat Jul 03 19:04:22 2004 +0200
+++ b/StandardSystemView.st	Sat Jul 03 19:12:03 2004 +0200
@@ -655,27 +655,27 @@
      depends on good-will of window manager"
 
     maxExtent ~= max ifTrue:[
-	maxExtent := max.
-	maxExtent x isNil ifTrue:[
-	    maxExtent := 9999 @ maxExtent y.
-	].
-	maxExtent y isNil ifTrue:[
-	    maxExtent := maxExtent x @ 9999.
-	].
+        maxExtent := max.
+        maxExtent x isNil ifTrue:[
+            maxExtent := 99999 @ maxExtent y.
+        ].
+        maxExtent y isNil ifTrue:[
+            maxExtent := maxExtent x @ 99999.
+        ].
 
-	drawableId notNil ifTrue:[
-	    device setWindowMinExtent:nil maxExtent:max in:drawableId
-	].
+        drawableId notNil ifTrue:[
+            device setWindowMinExtent:nil maxExtent:max in:drawableId
+        ].
 
-	"/ if my current extent is larger than the new
-	"/ maxExtent, adjust.
+        "/ if my current extent is larger than the new
+        "/ maxExtent, adjust.
 
-	(width notNil and:[height notNil]) ifTrue:[
-	    ((width > (max x)) or:
-	     [height > (max y)]) ifTrue: [
-		self extent:(max min:self extent)
-	    ]
-	]
+        (width notNil and:[height notNil]) ifTrue:[
+            ((width > (max x)) or:
+             [height > (max y)]) ifTrue: [
+                self extent:(max min:self extent)
+            ]
+        ]
     ].
 !
 
@@ -1015,11 +1015,16 @@
 
     borderWidth := 2.         "- notice: many window managers ignore this"
     device platformName = 'WIN32' ifTrue:[
-	minExtent := 0 @ 0.
+        minExtent := 0 @ 0.
     ] ifFalse:[
-	minExtent := 10 @ 10.
+        minExtent := 10 @ 10.
     ].
-    maxExtent := device usableExtent "- (0 @ device captionHeight)".
+
+"/ This code is bad for 2 reasons:
+"/ - KDE (3.2) WM does not show the maximize button if the maxExtent is restricted.
+"/ - why restrict the size of a window?
+"/    maxExtent := device usableExtent "- (0 @ device captionHeight)".
+
     label isNil ifTrue:[label := self class defaultLabel].
     icon isNil ifTrue:[icon := self class defaultIcon].
 
@@ -1535,7 +1540,7 @@
 !StandardSystemView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.158 2004-05-17 15:12:04 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/StandardSystemView.st,v 1.159 2004-07-03 17:11:09 stefan Exp $'
 ! !
 
 StandardSystemView initialize!