Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): forward the page cursor to the server browser viewer #32868

Openunbeholdendev(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromrefs/pull/32868/headopened View on GitHub

Showing 8 changed files with 66 additions and 0 deletions (loading 6).

x
0 of 8 viewed, 8 left
5 additions and 0 deletionsapps/mobile/src/features/browser/preview-stream.browser.tsModified
View file
@@ -1,4 +1,5 @@
import {
+ createPreviewCursor,
createPreviewFramePainter,
createPreviewStreamClient,
previewStreamModifiers,
@@ -140,8 +141,10 @@
if (!streaming && !stopped) reportStatus("streaming");
sendPictureInPictureFrame();
});
+ const cursor = createPreviewCursor(canvas);
const send = (message: PreviewStreamInput) => client?.send(message) ?? false;
const clearInput = () => {
+ cursor.show(false);
if (wheelFrame !== null) cancelAnimationFrame(wheelFrame);
if (mouseFrame !== null) cancelAnimationFrame(mouseFrame);
wheelFrame = mouseFrame = null;
@@ -173,6 +176,7 @@
onFrame: (jpeg) => painter.paint(jpeg),
onPointer: showAgentCursor,
+ onCursor: cursor.set,
onClipboard: (text) => post({ type: "clipboard", text }),
onDownload: (download) => post({ type: "download", ...download }),
onFileChooser: (chooser) => post({ type: "fileChooser", chooser }),
@@ -416,6 +420,7 @@
if (control?.controller !== "you") return;
if (event.pointerType !== "touch") {