Avoid scrolling on RFB object focus

Chrome scrolls the view to show as much as possible of the canvas when
we call focus(), which is likely not the desired behaviour.

This also exposes the ability to pass on future options when focusing
the RFB object manually.
This commit is contained in:
Pierre Ossman
2021-11-16 09:38:14 +01:00
parent 096449da35
commit 301714928b
3 changed files with 18 additions and 4 deletions

View File

@@ -392,6 +392,13 @@ describe('Remote Frame Buffer Protocol Client', function () {
client.focus();
expect(client._canvas.focus).to.have.been.calledOnce;
});
it('should include focus options', function () {
client._canvas.focus = sinon.spy();
client.focus({ foobar: 12, gazonk: true });
expect(client._canvas.focus).to.have.been.calledOnce;
expect(client._canvas.focus).to.have.been.calledWith({ foobar: 12, gazonk: true});
});
});
describe('#blur', function () {