diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/desktop/window.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/desktop/window.tsx b/src/desktop/window.tsx index a493bcf..ae91d27 100644 --- a/src/desktop/window.tsx +++ b/src/desktop/window.tsx @@ -16,8 +16,8 @@ export function Window(props: Window.Props) { dragTimeout.current = setTimeout(() => { dragging.value = false dragTimeout.current = null; - props.desktop.current?.removeEventListener("mousemove", onUpdatePosition) - props.desktop.current?.removeEventListener("mouseup", stopDrag) + props.desktop.current?.removeEventListener("pointermove", onUpdatePosition) + props.desktop.current?.removeEventListener("pointerup", stopDrag) }, 50) // intrdouce a small delay where the user can still drag the window without actually pressing down lmb to prevent accidental drops } }, [onUpdatePosition]); @@ -31,9 +31,9 @@ export function Window(props: Window.Props) { onStartDrag(e); dragging.value = true - props.desktop.current?.addEventListener("mousemove", onUpdatePosition) - props.desktop.current?.addEventListener("mouseleave", stopDrag, { once: true }) - props.desktop.current?.addEventListener("mouseup", stopDrag, { once: true }) + props.desktop.current?.addEventListener("pointermove", onUpdatePosition) + props.desktop.current?.addEventListener("pointerleave", stopDrag, { once: true }) + props.desktop.current?.addEventListener("pointerup", stopDrag, { once: true }) } } }, [onUpdatePosition, onStartDrag, stopDrag]); |
