Skip to content

Commit 74b036c

Browse files
committed
relative pointer coordinates must exclude headerbar offsets
1 parent 86b8eb0 commit 74b036c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

html5/js/Client.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,13 +1687,15 @@ class XpraClient {
16871687
const buttons = [];
16881688
const coords = [x, y];
16891689
let wid = 0;
1690-
if (this.server_is_desktop) wid = 1;
1690+
if (this.server_is_desktop) {
1691+
wid = 1;
1692+
}
16911693
if (win) {
16921694
wid = win.wid;
16931695
// add relative coordinates:
16941696
const pos = jQuery(win.div).position()
1695-
coords.push(Math.round(mouse.x - pos.left));
1696-
coords.push(Math.round(mouse.y - pos.top));
1697+
coords.push(Math.round(mouse.x - pos.left - win.leftoffset));
1698+
coords.push(Math.round(mouse.y - pos.top - win.topoffset));
16971699
e.preventDefault();
16981700
}
16991701
this.send([PACKET_TYPES.pointer_position, wid, coords, modifiers, buttons]);

0 commit comments

Comments
 (0)