diff options
author | Bruce Evans <bde@FreeBSD.org> | 2019-04-24 15:35:29 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 2019-04-24 15:35:29 +0000 |
commit | c7432537b1a67e964ed1d7b35977049301dc9189 (patch) | |
tree | 298224740b9aa75056abc98113170520e745ad0b /lib/libvgl/vgl.h | |
parent | ef5a75b1939b6a7437ca392147dbaba8c89b0ceb (diff) | |
download | src-c7432537b1a67e964ed1d7b35977049301dc9189.tar.gz src-c7432537b1a67e964ed1d7b35977049301dc9189.zip |
Refactor mouse freezing and fix some minor bugs.
VGLMouseFreeze() now only defers mouse signals and leaves it to higher
levels to hide and unhide the mouse cursor if necessary. (It is never
necessary, but is done to simplify the implementation. It is slow and
flashes the cursor. It is still done for copying bitmaps and clearing.)
VGLMouseUnFreeze() now only undoes 1 level of freezing. Its old
optimization to reduce mouse redrawing is too hard to do with unhiding
in higher levels, and its undoing of multiple levels was a historical
mistake.
VGLMouseOverlap() determines if a region overlaps the (full) mouse region.
VGLMouseFreezeXY() is the freezing and a precise overlap check combined
for the special case of writing a single pixel. This is the single-pixel
case of the old VGLMouseFreeze() with cleanups.
Fixes:
- check in more cases that the application didn't pass an invalid VIDBUF
- check for errors from copying a bitmap to the shadow buffer
- freeze the mouse before writing to the shadow buffer in all cases. This
was not done for the case of writing a single pixel (there was a race)
- don't spell the #defined values for VGLMouseShown as 0, 1 or boolean.
Notes
Notes:
svn path=/head/; revision=346639
Diffstat (limited to 'lib/libvgl/vgl.h')
-rw-r--r-- | lib/libvgl/vgl.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libvgl/vgl.h b/lib/libvgl/vgl.h index 31d2f93f6ccd..c04f274f1abd 100644 --- a/lib/libvgl/vgl.h +++ b/lib/libvgl/vgl.h @@ -134,7 +134,9 @@ void VGLMouseSetStdImage(void); int VGLMouseInit(int mode); void VGLMouseRestore(void); int VGLMouseStatus(int *x, int *y, char *buttons); -int VGLMouseFreeze(int x, int y, int width, int hight, u_long color); +void VGLMouseFreeze(void); +int VGLMouseFreezeXY(int x, int y); +int VGLMouseOverlap(int x, int y, int width, int hight); void VGLMouseUnFreeze(void); /* simple.c */ void VGLSetXY(VGLBitmap *object, int x, int y, u_long color); |