[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Fallback window size on Mac is too small (#288)

Tobias Pape notifications at github.com
Fri Oct 5 11:50:19 UTC 2018


Ok, here's the roundup:

 1. Mac: seems to has ever used 10 at 10 as fallback, apparently since the 1990s ([fallback still](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/a8a1dc1e33267e0fa2dab22959e41d0a072420d9/platforms/iOS/vm/Common/Classes/sqSqueakNullScreenAndWindow.m#L70) ) 
    But sometimes returns `16 at 16` [when headless is detected](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/a8a1dc1e33267e0fa2dab22959e41d0a072420d9/platforms/iOS/vm/OSX/sqSqueakMainApplication%2Bscreen.m#L52)

 2. Windows: 
     - Tries window's size, if window is there
     - [Tries saved size (which comes from image)](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/e2fa2d10b4e85f1fae03f4e759527eb8e1742385/platforms/win32/vm/sqWin32Window.c#L1752)
    _However_, when setting the window size, it 
     - [Avoids doing that in headless mode](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/e2fa2d10b4e85f1fae03f4e759527eb8e1742385/platforms/win32/vm/sqWin32Window.c#L997)     
     - [Tries saved size (which comes from vm)](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/e2fa2d10b4e85f1fae03f4e759527eb8e1742385/platforms/win32/vm/sqWin32Window.c#L1000),
     - [Uses default of `640 at 480` (aka VGA)](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/e2fa2d10b4e85f1fae03f4e759527eb8e1742385/platforms/win32/vm/sqWin32Window.c#L1000)
     - [but makes sure that it's at least `64 at 64`](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/e2fa2d10b4e85f1fae03f4e759527eb8e1742385/platforms/win32/vm/sqWin32Window.c#L1007)

    Which means that one call to `SetWindowSize` makes everything even more inconsistent
 
 3. Unix: First note: reading the Screen size actually [_can change the physical screen size_](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/a8a1dc1e33267e0fa2dab22959e41d0a072420d9/platforms/unix/vm-display-X11/sqUnixX11.c#L4956)
    - [Starts from the images saved size (which comes from image)](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/a8a1dc1e33267e0fa2dab22959e41d0a072420d9/platforms/unix/vm-display-X11/sqUnixX11.c#L4935)
    - [In headless, gives that saved size](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/a8a1dc1e33267e0fa2dab22959e41d0a072420d9/platforms/unix/vm-display-X11/sqUnixX11.c#L4937) or, if that is not available, [just `64 at 64`](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/a8a1dc1e33267e0fa2dab22959e41d0a072420d9/platforms/unix/vm-display-X11/sqUnixX11.c#L4938)
     - Only then, after possible resizing of the physical window, the [actual size is determined](https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/a8a1dc1e33267e0fa2dab22959e41d0a072420d9/platforms/unix/vm-display-X11/sqUnixX11.c#L4956)

----- 

_Nothing_ of this is consistent. The most common thing is to return the saved size or `64 at 64`.

The only thing to fix that here is to actually make the Cocoa VM query the image for its saved size, yes.
But save for that, I would avoid hardcoding like #289 .




-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/288#issuecomment-427338917
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181005/ab73cff2/attachment-0001.html>


More information about the Vm-dev mailing list