[Tether 0.1.15, bundled open-terminal 0.17.17, Open WebUI 0.13.3] [macOS 27.2.1, Apple M2 (Mac mini), 1920×1080] Desktop view lags when the mouse moves and windows can't be dragged

オープン
#53 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
macos, python, typescript
領域
backend, desktop

調査の方向性

Start with open_terminal/desktop/native.py, where the issue identifies the input handler and locally tested changes; check how position() and handle() pass button state and how commands() processes input and frame acknowledgements. Reproduce the lag and failed window drag on macOS, then verify both behaviors are fixed and desktop frames continue while the pointer moves.

索引モデルが issue の本文から書いたものです。

説明

Version

Tether 0.1.15, bundled open-terminal 0.17.17, Open WebUI 0.13.3

Platform

macOS 27.2.1, Apple M2 (Mac mini), 1920×1080

Description

The desktop view (native frames transport, open_terminal/desktop/native.py) has two macOS problems:

1. Laggy, stalling stream while the mouse moves

pyautogui's macOS backend sleeps DARWIN_CATCH_UP_TIME (default 10 ms) after every mouse event, so each moveTo/scroll takes about 12–15 ms. The browser sends pointer moves up to 60 times a second (one per animation frame), and all input runs on the same single-thread executor as screen capture (max_workers=1). The commands() loop awaits each input in turn, and frameAck arrives on that same loop, so acks queue behind mouse events and frames stop while the mouse moves.

Measured on the Mac: moveTo takes 11.9 ms by default, 1.75 ms with DARWIN_CATCH_UP_TIME = 0.001, and 0.25 ms with 0. The relay on the server side was not the bottleneck (≤6% CPU, empty socket send queues).

2. Windows cannot be dragged

While a button is held, position() still calls moveTo(), which posts kCGEventMouseMoved. macOS only drags windows, selects text and drags files on kCGEvent*MouseDragged events, so press, move and release never drags.

Steps to reproduce
  1. Connect Tether on macOS and open the computer's desktop from Open WebUI.
  2. Move the mouse quickly: the picture freezes or jumps.
  3. Try to drag a window by its title bar: it doesn't move.
Additional context

Fix tested locally in open_terminal/desktop/native.py; both problems went away:

         self.input = pyautogui
         self.input.PAUSE = 0
+        self.input.DARWIN_CATCH_UP_TIME = 0.001
@@
-    def position(self, x, y):
+    def position(self, x, y, buttons=()):
         ...
-        self.input.moveTo(
+        target = (
             self.origin[0] + round(x * self.screen_width / self.width),
             self.origin[1] + round(y * self.screen_height / self.height),
         )
+        if sys.platform == "darwin" and buttons:
+            self.input.platformModule._dragTo(*target, next(iter(buttons)))
+        else:
+            self.input.moveTo(*target)
@@ def handle(self, message, keys, buttons):
-            self.position(message.x, message.y)
+            self.position(message.x, message.y, buttons)

Suggested longer-term fixes:

  • Handle frameAck directly in commands() instead of behind input work, so input can't stall frames.
  • Coalesce queued mouse moves so only the latest position is applied.
  • Post Quartz drag events directly instead of using the private _dragTo.
主要言語
TypeScript
スター
168
フォーク
10
平均マージ
1分
マージ済み PR(30日)
15

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

open-webui/tether のほかの issue

open-webui/tether の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。