[squeak-dev] trap for dirty image works in FreeBSD

Bert Freudenberg bert at freudenbergs.de
Wed Sep 5 10:26:34 UTC 2012

On 2012-09-05, at 05:29, Gary Dunn <garydunnhi at gmail.com> wrote:

> Awhile back I was trying to solve the issue where FreeBSD let me
> logout without exiting Squeak, and with no warning. This would cause
> significant corruption of the open image. Very easy mistake to make
> with Squeak open on a different desktop. To fix this I needed to
> modify the VM, but I could not compile the VM source on FreeBSD due to
> the GPL licensing issue with gcc. Part of the solution would involve
> Gnome code, borrowed from other programs such as gedit, because I had
> settled on Gnome for my desktop environment.
> For my "new" box I decided to try a more traditional approach, no
> Gnome and no KDE, just a window manager. Being a sucker for glitz I
> decided to give Enlightenment a try. I am happy to report that in this
> combination the logoff trap works correctly. If I logoff with Squeak
> open I get Squeak's "save changes" dialog, and if I select Cancel
> Enlightenment offers to stop the logoff.
> Don't know if some enterprising VM hacker fixed it, but if so, thanks!

The Squeak VM still does not handle X session management events, but it does handle X window close. I guess Enlightenment falls back onto this older mechanism if an application does not react to the session protocol, and just sends a close event, and waits for the app to quit.

We put that in back in 2007 as part of the OLPC Etoys changes. Formerly pressing the X on the window frame just killed the image. Now it instead sends an event to the image, which handles it, usually by putting up the "save changes?" dialog. You can override this by registering your own event handler (see windowEventHandler:).

To make this work with other window managers I guess we would need to handle (part of) the X Session Management protocol [*] in the VM. Patches welcome :)

- Bert -

[*] http://www.x.org/releases/X11R7.7/doc/libSM/xsmp.html

More information about the Squeak-dev mailing list