aboutsummaryrefslogtreecommitdiff
path: root/lib/libvgl/vgl.h
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2019-04-29 14:13:53 +0000
committerBruce Evans <bde@FreeBSD.org>2019-04-29 14:13:53 +0000
commitc0ce6f7d91bee6ac83c799e4a5574bd340f37f67 (patch)
tree2e0b997ca4ba59eb0a9daefacc432f93787bb8c8 /lib/libvgl/vgl.h
parent8e7130a8a7557268cebd5166e3134b77efa72101 (diff)
downloadsrc-c0ce6f7d91bee6ac83c799e4a5574bd340f37f67.tar.gz
src-c0ce6f7d91bee6ac83c799e4a5574bd340f37f67.zip
Refactor and simplify hiding the mouse cursor and fix bugs caused by
complications in the previous methods. r346761 broke showing the mouse cursor after changing its state from off to on (including initially), since showing the cursor uses the state to decide whether to actually show and the state variable was not changed until after null showing. Moving the mouse or copying under the cursor fixed the problem. Fix this and similar problems for the on to off transition by changing the state variable before drawing the cursor. r346641 failed to turn off the mouse cursor on exit from vgl. It hid the cursor only temporarily for clearing. This doesn't change the state variable, so unhiding the cursor after clearing restored the cursor if its state was on. Fix this by changing its state to VGL_MOUSEHIDE using the application API for changing the state. Remove the VGLMouseVisible state variable and the extra states given by it. This was an optimization that was just an obfuscation in at least the previous version. Staticize VGLMouseAction(). Remove VGLMousePointerShow/Hide() except as internals in __VGLMouseMode(). __VGLMouseMouseMode() is the same as the application API VGLMouseMouseMode() except it returns the previous mode which callers need to know to restore it after hiding the cursor. Use the refactoring to make minor improvements in a simpler way than was possible: - in VGLMouseAction(), only hide and and unhide the mouse cursor if the mouse moved - in VGLClear(), only hide and and unhide the mouse cursor if the clearing method would otherwise clear the cursor.
Notes
Notes: svn path=/head/; revision=346889
Diffstat (limited to 'lib/libvgl/vgl.h')
-rw-r--r--lib/libvgl/vgl.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libvgl/vgl.h b/lib/libvgl/vgl.h
index 53e01b99e45b..aa0eda9eaa28 100644
--- a/lib/libvgl/vgl.h
+++ b/lib/libvgl/vgl.h
@@ -125,10 +125,8 @@ int VGLSetVScreenSize(VGLBitmap *object, int VXsize, int VYsize);
int VGLPanScreen(VGLBitmap *object, int x, int y);
int VGLSetSegment(unsigned int offset);
/* mouse.c */
-void VGLMousePointerShow(void);
-void VGLMousePointerHide(void);
+int __VGLMouseMode(int mode);
void VGLMouseMode(int mode);
-void VGLMouseAction(int dummy);
void VGLMouseSetImage(VGLBitmap *AndMask, VGLBitmap *OrMask);
void VGLMouseSetStdImage(void);
int VGLMouseInit(int mode);