aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/vimium_frontend.coffee14
1 files changed, 7 insertions, 7 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 23e320c0..30d76523 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -1073,21 +1073,21 @@ CursorHider =
# Hides the cursor when the browser scrolls, and prevent mouse from hovering while invisible
#
cursorHideStyle: null
+ isScrolling: false
showCursor: -> @cursorHideStyle.remove()
hideCursor: ->
document.head.appendChild @cursorHideStyle unless @cursorHideStyle.parentElement
- onMouseMove: (event) -> CursorHider.showCursor()
+ onMouseMove: (event) ->
+ if CursorHider.isScrolling # This event was caused by scrolling, don't show the cursor.
+ CursorHider.isScrolling = false
+ else
+ CursorHider.showCursor()
onScroll: (event) ->
+ CursorHider.isScrolling = true
CursorHider.hideCursor()
- # Ignore next mousemove, caused by the scrolling, so the mouse doesn't re-show straight away.
- window.removeEventListener "mousemove", CursorHider.onMouseMove
- window.addEventListener "mousemove", ->
- window.addEventListener "mousemove", CursorHider.onMouseMove
- window.removeEventListener "mousemove", arguments.callee
-
init: ->
@cursorHideStyle = document.createElement("style")
@cursorHideStyle.innerHTML = """