[WIN32][VM][BUG] Initial window position

Andreas Raab andreas.raab at gmx.de
Sat Mar 8 21:57:46 UTC 2003


Eddie,

Thanks for the code - it's been incorporated into 3.4.1.

Cheers,
  - Andreas

> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of Eddie Cottongim
> Sent: Friday, March 07, 2003 1:07 AM
> To: The general-purpose Squeak developers list
> Subject: [WIN32][VM][BUG] Initial window position
> 
> 
> This has been brought up before, but I'll mention it with as 
> many details as
> I can.
> 
> 1. Set the taskbar height to larger than normal (2 rows high 
> for example)
> 2. Open a stock image.
> 3. Maximize the Squeak window.
> 4. Save & Quit.
> 5. Re-open the image.
> 
> The Squeak window will now open partially off the screen (Its 
> one-half of
> the title bar height too high.) The problem apparently 
> manifests itself
> mainly with non-standard taskbar heights.
> 
> On the IRC channel (openprojects.net#squeak) we found that 
> the problem is
> almost certainly in sqWin32Window.c: SetWindowSize.
> 
> Here is my suggestion to fix it:
> 
> Instead of:
>  /* maximum size is screen size */
>   maxWidth  = GetSystemMetrics(SM_CXFULLSCREEN);
>   maxHeight = GetSystemMetrics(SM_CYFULLSCREEN);
> 
> Do this:
> 
> /* Get the size of the work area (screen - taskbar ) */
>   SystemParametersInfo( SPI_GETWORKAREA, 0, &workArea, 0 ); 
> /* workArea is a
> RECT */
>   maxWidth = workArea.right - workArea.left;
>   maxHeight = workArea.bottom - workArea.top;
> 
> Then later,
> Instead of
>   width  = (width <= (maxWidth + deltaWidth))  ?
>     width : (maxWidth  + deltaWidth );
>   height = (height <= (maxHeight + deltaHeight)) ?
>     height : (maxHeight + deltaHeight);
> 
> Do this:
>   width  = (width <= maxWidth )  ?
>     width : maxWidth;
>   height = (height <= maxHeight ) ?
>     height : maxHeight;
> 
> This seems to do the trick for me.
> 
> Thanks,
> Eddie
> 
> 
> 
> 
> 
> 



More information about the Squeak-dev mailing list