[Vm-dev] Resizing the display of an image with no real display (RFB)

Levente Uzonyi leves at elte.hu
Thu Sep 13 12:42:42 UTC 2012


Hi,

accessing a remote image via RFB is fun, but sometimes you do it from 
different machines which have very different display resolution. Resizing 
an image using vm-display-null is not possible without quitting the image, 
using a script to resize it and finally restarting. It's just tedious. 
So I finally prepared the files which add some VM support for a less 
cumbersome way of resizing the image:

for Cog: http://leves.web.elte.hu/squeak/cog/sqUnixDisplayNull.c
for the interpreter: 
http://leves.web.elte.hu/squeak/interpreter/sqUnixDisplayNull.c

Please add them to the svn repository.

The change is pretty simple, it adds the following implementation for 
the display_ioSetDisplayMode function:

   setSavedWindowSize((w << 16) + (h & 0xFFFF));
   return 1;

So instead of ignoring the request for resizing the display, the VM stores 
the width and height information in the image header and returns with 1, 
so it will trigger re-reading the information from the header on the 
Smalltalk side.

With a VM including this change the following expression will change the 
display size to 1920x1080:

DisplayScreen depth: 32 width: 1920 height: 1080 fullscreen: false.

Cheers,
Levente


More information about the Vm-dev mailing list