The relevant `on-paint' call is one that is forced for a GL
canvas to try to draw a frame's content before the frame is
shown. Sometimes, thread scheduling would let the frame get
sufficiently initialized at the Cocoa level before the `on-paint'
call happened, but sometimes not.
I started from tabs that are not on the beginning of lines, and in
several places I did further cleanings.
If you're worried about knowing who wrote some code, for example, if you
get to this commit in "git blame", then note that you can use the "-w"
flag in many git commands to ignore whitespaces. For example, to see
per-line authors, use "git blame -w <file>". Another example: to see
the (*much* smaller) non-whitespace changes in this (or any other)
commit, use "git log -p -w -1 <sha1>".
Cairo doesn't seem to deal correctly with an HDC produced
by BeginPaint() that has a clipping region. The problem affects
only Win64. Work around the problem by drawing to a separate
HDC and copying to/from the screen. (To see the problem before
this patch, draw the DrRacket window to the edge of the screen
and back, and observe tha the toolbar doesn't update correctly.)
This change could affect performance, but it should mostly
be limited to refresh when a window moves.
When the theme-specified default font has a localized name,
using it as a Pango faily name doesn't work, with the result that
text on controls could be truncated. Get a Pango-friendly
name by converting a LOGFONT to a Pango font description and
getting the name from the font description.
Use the system-supplied region to intersect with the
window region, so that drawng the border doesn't replace
the window content.
See also Kieron Hardy's post on the users' list, 2/7/12.
Since the number of monitors can change at any time, reliable
use of these functions requires handling failure in some way.
Handling #f results is easier (and less likely to mask other
problems) than catching exceptions.
Refresh was wrong in the case that a canvas had been "reset"
in certain ways, such as showing and hiding, and the canvas is
drawn on before a Win32-level refresh event was processed. In
that case `on-paint' wasn't called, and it should have been.
Closes PR 12152