HomeFreeBSD

Refactor and simplify hiding the mouse cursor and fix bugs caused by

Description

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.

Details

Provenance
bdeAuthored on
Parents
rS346888: Stop checking TD_IDLETHREAD() in buffer cache routines.
Branches
Unknown
Tags
Unknown