A gowid user reported that mouse movement in their gowid(tcell) application
was causing the console cursor to flicker on windows, jumping from the current
position in the console to the top left corner, and back again. In part, this
is an artifact of the way I render a gowid "canvas" - calling HideCursor()
unilaterally, then calling ShowCursor(x, y) if the canvas contains a logical
cursor that is within bounds. Because currently every mouse event causes a
gowid application redraw, on windows the effect is to cause the cursor to jump
to the top left briefly, disappear, then reappear in the previous
position. You can see it most easily by moving the mouse rapidly left and
right.
An upstream fix is for me to only call HideCursor() if I know I'm not going to
call ShowCursor(x, y). But the flicker can also be eliminated by removing the
call to setCursorPos(0, 0) in console_win.go before hiding the cursor. The
single call to showCursor() in console_win.go is preceded by setting cursor
coordinates explicitly, so I don't think anything depends on the assumption
that a hidden cursor has been set to position (0, 0) first.
* Fix cScreen.Fini() race condition
Closesgdamore/tcell#158
* Tidy up Windows magic, and fix event ordering
* Move a couple of magic values into constants
* Add more explanatory comments
* Fix ordering WaitForMultipleObjects to give cancellation priority
* Also correct some indentation and minor formatting stuff.
* Use `chan struct{}` for `scandone` to not deadlock
fixes#38 Broke wide characters in last update
fixes#39 Clean up logic for encodings, enhance fallback options
fixes#36 Support more mouse buttons on Windows.