Do not show cursor on small movement

This commit is contained in:
Rafostar
2020-10-16 22:11:54 +02:00
parent c9d9927bb1
commit b2e052d7a4

View File

@@ -344,9 +344,18 @@ var App = GObject.registerClass({
if(this.posX === posX && this.posY === posY)
return;
/* Do not show cursor on small movements */
let ignoreMovement = (
Math.abs(this.posX - posX) <= 0.5
&& Math.abs(this.posY - posY) <= 0.5
);
this.posX = posX;
this.posY = posY;
if(ignoreMovement)
return;
this.player.widget.set_cursor(this.defaultCursor);
this.setHideCursorTimeout();