freebsd-dev/lib/libvgl
Bruce Evans 014ddcbce4 Fix accessing pixels under the mouse cursor:
Reading of single pixels didn't look under the cursor.

Copying of 1x1 bitmaps didn't look under the cursor for either reading
or writing.

Copying of larger bitmaps looked under the cursor for at most the
destination.

Copying of larger bitmaps looked under a garbage cursor (for the Display
bitmap) when the destination is a MEMBUF.  The results are not used, so
this only wasted time and flickered the cursor.

Writing of single pixels looked under a garbage cursor for MEMBUF
destinations, as above except this clobbered the current cursor and
didn't update the MEMBUF.  Writing of single pixels is not implemented
yet in depths > 8.  Otherwise, writing of single pixels worked.  It was
the only working case for accessing pixels under the cursor.

Clearing of MEMBUFs wasted time freezing the cursor in the Display bitmap.

The fixes abuse the top bits in the color arg to the cursor freezing
function to control the function.  Also clear the top 8 bits so that
applications can't clobber the control bits or create 256 aliases for
every 24-bit pixel value in depth 32.

Races fixed:

Showing and hiding the cursor only tried to avoid races with the mouse
event signal handler for internal operations.  There are still many
shorter races from not using volatile or sig_atomic_t for the variable
to control this.  This variable also controls freezes, and has more
complicated states than before.

The internal operation of unfreezing the cursor opened a race window
by unsetting the signal/freeze variable before showing the cursor.
2019-03-27 18:03:34 +00:00
..
bitmap.c Fix accessing pixels under the mouse cursor: 2019-03-27 18:03:34 +00:00
keyboard.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
main.c Fix buffer overruns in modes with color depth more than 8. 2019-03-24 18:57:03 +00:00
Makefile First pass through library packaging. 2016-02-04 21:16:35 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
mouse.c Fix accessing pixels under the mouse cursor: 2019-03-27 18:03:34 +00:00
simple.c Fix accessing pixels under the mouse cursor: 2019-03-27 18:03:34 +00:00
text.c Fix the type of the color args for VGLMouseFreeze(), VGLBitmapPutChar(), 2019-03-24 20:36:35 +00:00
vgl.3 Oops, my previous commit to libvgl was missing the change of VGLSetBorder() 2019-03-24 20:43:21 +00:00
vgl.h Oops, my previous commit to libvgl was missing the change of VGLSetBorder() 2019-03-24 20:43:21 +00:00