shoes/shoes4 — pull request #660 by jasonrclark (2014-04-21 03:45:44+00:00)
Title: Fix for hang during painting

I believe I found the root cause of #559 :rocket: :boom:

The sequence of steps that caused this to happen was:
* Adding a new element with a painter in it that requires the positioning information
* Call to `alert` which runs an `Shell#open` that triggers a redraw
* Since it wasn't positioned yet the painter would fail
* For whatever reason SWT swallowed that error and hung rather than giving us a nice stacktrace.

How on earth did I find that? Well, I tried to make a raw SWT app duplication on it (which didn't work), but in the course of it noticed that `alert` vs. `ask` had significantly different code in them for popping the dialog. When I tried `ask` instead of `alert`, it failed with a little more signal than we'd been getting... which led me to this.

This definitely fixes the minesweeper issues I was seeing, but I wonder whether there are cases where my `positioned?` method on `Dimensions` might not be quite right, but too frazzled to think of them right now :stuck_out_tongue_winking_eye: An alternative to how I'm doing it now would be to have the slot code explicitly call a method (or put it in the common methods), to directly flag a DSL object once it's been positioned at least once.

Also worth considering how to spec this out. If we keep `positioned?` that's easy enough, but the common painter business doesn't have much in the way of specs against it yet.