mirror of
https://github.com/vector-im/element-web.git
synced 2026-01-06 00:51:48 +01:00
only dispatch user_activity event if the mouse actually moves (rather than the DOM moving under the mouse)
This commit is contained in:
parent
bed7d50ab8
commit
ba090a6ad5
@ -43,7 +43,18 @@ class UserActivity {
|
||||
document.onkeypress = undefined;
|
||||
}
|
||||
|
||||
_onUserActivity() {
|
||||
_onUserActivity(event) {
|
||||
if (event.screenX) {
|
||||
if (event.screenX === this.lastScreenX &&
|
||||
event.screenY === this.lastScreenY)
|
||||
{
|
||||
// mouse hasn't actually moved
|
||||
return;
|
||||
}
|
||||
this.lastScreenX = event.screenX;
|
||||
this.lastScreenY = event.screenY;
|
||||
}
|
||||
|
||||
this.lastActivityAtTs = (new Date).getTime();
|
||||
if (this.lastDispatchAtTs < this.lastActivityAtTs - MIN_DISPATCH_INTERVAL) {
|
||||
this.lastDispatchAtTs = this.lastActivityAtTs;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user