mouse - sync the patch with upstream
Merge pull request #376 from lslezak/mouse_sync

Mouse - sync the patch with upstream