HELP! Mac vs Win display using DisplayScreen>>depth:width:height:fullscreen:

David N. Smith (IBM) dnsmith at watson.ibm.com
Thu Sep 20 22:25:15 UTC 2001


Bert:

I removed the call and things now work on both platforms. I agree that the message should be implemented uniformly.

The white border comes from forcing it to be white; I get black if I don't.

For what it is worth, here is the code that works on both Mac and Win. The variable frame holds 800 at 600, and the backgroundColor is white.

openInWorld	
	self frameForWorld.
	super openInWorld.
	self step.
	"DisplayScreen depth: 8 width: frame width height: frame height fullscreen: true"

frameForWorld	
	| rect orx ory |
	rect := self realScreenSize.
	orx := (rect width - frame width) // 2.
	ory := (rect height - frame height) // 2.
	self
		bounds: (orx @ ory
			extent: frame width @ frame height);
		color: self class backgroundColor

realScreenSize
	" Go to full screen mode and get the real screen size "
	| win sc |
	Smalltalk fullScreenMode: true.
	sc := ScreenController new.
	sc restoreDisplay.
	win := Display boundingBox.
	^ win

Dave

At 14:38 +0200 9/20/01, Bert Freudenberg wrote:
>On Wed, 19 Sep 2001, Ned Konz wrote:
>
>> On Wednesday 19 September 2001 05:44 pm, David N. Smith (IBM) wrote:
>> > All:
>> >
>> > I've been using DisplayScreen>>depth:width:height:fullscreen:  (with
>> > fullscreen set to TRUE) at start up of an application on the Mac for over a
>> > year. I run 1024x768 screen and show a 600x800 morph. I get a full screen
>> > with the morph centered and a white border. Works great. (I'm on 2.8 for
>> > various porting and stability reasons, and I've tested various sized Mac
>> > screens to make sure it works.)
>>
>> [snip]
>>
>> > Anyone know of any workarounds, tricks, or whatever? While I hate to test
>> > for the platform, if I have to I will.
>>
>> Does
>>         Smalltalk fullScreenMode: true
>> do anything for you?
>> DisplayScreen>>depth:width:height:fullscreen: doesn't seem to force
>> fullscreen on my Windows system; on Linux it doesn't seem to do anything at
>> all.
>
>Yes, it's a no-op in Linux. The method comment says
>
>	"Force Squeak's window (if there's one) into a new size and depth."
>
>The behaviour in fullscreen is undefined. The Mac version seems to achieve
>a good compromise when the VM can not (does not want to?) change the
>screen resolution. I propose other implementations should follow it. [The
>white border seems odd, though - I would have expected a black one]
>
>-- Bert


-- 
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
dnsmith at watson.ibm.com




More information about the Squeak-dev mailing list