perf(arrowpad,snip): read grips only while a laser is on them; the narration panel idles at 10 checks a second

This commit is contained in:
AstronautCheetah committed 2026-10-15 00:08:46 -04:00
1 parent d03959a932
commit 26a254058c
5 files changed
+56 -42

No files matched your search

+4
View File
@@ -3,6 +3,10 @@
## Unreleased
### Fixed
- **Less load on SteamVR from Arrow Pad and Screen snip's narration panel:** they read the
controllers' grip only while a laser is on them (each read waits on SteamVR's shared property
lock, which SteamVR and Steam use too), and the narration panel checks for events 10 times a
second until a laser is on it.
- **Android Mirror coming back after the phone slept** (it reconnects by itself): the new window
showed in the dashboard, was put back where the mirror floated, and left the dashboard showing
nothing. The dashboard now goes back to the window it showed before, and the mirror's trip
+19 -19
View File
@@ -160,7 +160,7 @@ msgstr "la revisión del estado no terminó (tardó más de un minuto)"
msgid "Help make Frame Tweaks better"
msgstr "Ayuda a mejorar Frame Tweaks"
#: gui/frame-tweaks-gui.py:1392 gui/prefs_page.py:185 packs/original/snip/frame-snip:1306
#: gui/frame-tweaks-gui.py:1392 gui/prefs_page.py:185 packs/original/snip/frame-snip:1314
msgid "Cancel"
msgstr "Cancelar"
@@ -3510,75 +3510,75 @@ msgstr "no hay ninguna ventana con el foco"
msgid "couldn't read the window's picture"
msgstr "no se pudo leer la imagen de la ventana"
#: packs/original/snip/frame-snip:1286
#: packs/original/snip/frame-snip:1294
msgid "Screen snip"
msgstr "Recorte de pantalla"
#: packs/original/snip/frame-snip:1292
#: packs/original/snip/frame-snip:1300
msgid ""
"Drag a rectangle to snip, then adjust it with its handles · Esc or right-click cancels"
msgstr ""
"Arrastra un rectángulo para recortar y luego ajústalo con sus tiradores · Esc o clic derecho cancela"
#: packs/original/snip/frame-snip:1305
#: packs/original/snip/frame-snip:1313
msgid "Copy"
msgstr "Copiar"
#: packs/original/snip/frame-snip:1305
#: packs/original/snip/frame-snip:1313
msgid "Save"
msgstr "Guardar"
#: packs/original/snip/frame-snip:1306
#: packs/original/snip/frame-snip:1314
msgid "Narrate"
msgstr "Narrar"
#: packs/original/snip/frame-snip:1460
#: packs/original/snip/frame-snip:1468
msgid "Couldn't copy the snip"
msgstr "No se pudo copiar el recorte"
#: packs/original/snip/frame-snip:1460
#: packs/original/snip/frame-snip:1468
msgid "Snip copied"
msgstr "Recorte copiado"
#: packs/original/snip/frame-snip:1460
#: packs/original/snip/frame-snip:1468
msgid "the desktop isn't available"
msgstr "el escritorio no está disponible"
#: packs/original/snip/frame-snip:1467
#: packs/original/snip/frame-snip:1475
msgid "Couldn't save the snip"
msgstr "No se pudo guardar el recorte"
#: packs/original/snip/frame-snip:1467
#: packs/original/snip/frame-snip:1475
msgid "Snip saved"
msgstr "Recorte guardado"
#: packs/original/snip/frame-snip:1475 packs/original/snip/frame-snip:1496
#: packs/original/snip/frame-snip:1483 packs/original/snip/frame-snip:1504
msgid "No text found in the snip"
msgstr "No se encontró texto en el recorte"
#: packs/original/snip/frame-snip:1478
#: packs/original/snip/frame-snip:1486
msgid "Couldn't copy the text"
msgstr "No se pudo copiar el texto"
#: packs/original/snip/frame-snip:1478
#: packs/original/snip/frame-snip:1486
msgid "Text copied"
msgstr "Texto copiado"
#: packs/original/snip/frame-snip:1501
#: packs/original/snip/frame-snip:1509
msgid "Narrate needs the Speech engine"
msgstr "Narrar necesita el motor de voz"
#: packs/original/snip/frame-snip:1502
#: packs/original/snip/frame-snip:1510
msgid ""
"Narrate reads the snip aloud with the Speech engine (Piper, on the Frame itself), which isn't installed, or is missing its voice."
msgstr ""
"Narrar lee el recorte en voz alta con el motor de voz (Piper, en el propio Frame), que no está instalado o le falta su voz."
#: packs/original/snip/frame-snip:1601 packs/original/snip/frame-snip:1598
#: packs/original/snip/frame-snip:1609 packs/original/snip/frame-snip:1606
msgid "Couldn't take a snip"
msgstr "No se pudo hacer un recorte"
#: packs/original/snip/frame-snip:1601
#: packs/original/snip/frame-snip:1609
msgid "empty picture"
msgstr "imagen vacía"
@@ -3672,7 +3672,7 @@ msgstr "Copiar imagen"
msgid "Put the snip's image on the clipboard"
msgstr "Poner la imagen del recorte en el portapapeles"
#: packs/original/snip/frame-snip:684 packs/original/snip/frame-snip:1305
#: packs/original/snip/frame-snip:684 packs/original/snip/frame-snip:1313
msgid "Copy text"
msgstr "Copiar texto"
+19 -19
View File
@@ -154,7 +154,7 @@ msgstr ""
msgid "Help make Frame Tweaks better"
msgstr ""
#: gui/frame-tweaks-gui.py:1392 gui/prefs_page.py:185 packs/original/snip/frame-snip:1306
#: gui/frame-tweaks-gui.py:1392 gui/prefs_page.py:185 packs/original/snip/frame-snip:1314
msgid "Cancel"
msgstr ""
@@ -3291,73 +3291,73 @@ msgstr ""
msgid "couldn't read the window's picture"
msgstr ""
#: packs/original/snip/frame-snip:1286
#: packs/original/snip/frame-snip:1294
msgid "Screen snip"
msgstr ""
#: packs/original/snip/frame-snip:1292
#: packs/original/snip/frame-snip:1300
msgid ""
"Drag a rectangle to snip, then adjust it with its handles · Esc or right-click cancels"
msgstr ""
#: packs/original/snip/frame-snip:1305
#: packs/original/snip/frame-snip:1313
msgid "Copy"
msgstr ""
#: packs/original/snip/frame-snip:1305
#: packs/original/snip/frame-snip:1313
msgid "Save"
msgstr ""
#: packs/original/snip/frame-snip:1306
#: packs/original/snip/frame-snip:1314
msgid "Narrate"
msgstr ""
#: packs/original/snip/frame-snip:1460
#: packs/original/snip/frame-snip:1468
msgid "Couldn't copy the snip"
msgstr ""
#: packs/original/snip/frame-snip:1460
#: packs/original/snip/frame-snip:1468
msgid "Snip copied"
msgstr ""
#: packs/original/snip/frame-snip:1460
#: packs/original/snip/frame-snip:1468
msgid "the desktop isn't available"
msgstr ""
#: packs/original/snip/frame-snip:1467
#: packs/original/snip/frame-snip:1475
msgid "Couldn't save the snip"
msgstr ""
#: packs/original/snip/frame-snip:1467
#: packs/original/snip/frame-snip:1475
msgid "Snip saved"
msgstr ""
#: packs/original/snip/frame-snip:1475 packs/original/snip/frame-snip:1496
#: packs/original/snip/frame-snip:1483 packs/original/snip/frame-snip:1504
msgid "No text found in the snip"
msgstr ""
#: packs/original/snip/frame-snip:1478
#: packs/original/snip/frame-snip:1486
msgid "Couldn't copy the text"
msgstr ""
#: packs/original/snip/frame-snip:1478
#: packs/original/snip/frame-snip:1486
msgid "Text copied"
msgstr ""
#: packs/original/snip/frame-snip:1501
#: packs/original/snip/frame-snip:1509
msgid "Narrate needs the Speech engine"
msgstr ""
#: packs/original/snip/frame-snip:1502
#: packs/original/snip/frame-snip:1510
msgid ""
"Narrate reads the snip aloud with the Speech engine (Piper, on the Frame itself), which isn't installed, or is missing its voice."
msgstr ""
#: packs/original/snip/frame-snip:1601 packs/original/snip/frame-snip:1598
#: packs/original/snip/frame-snip:1609 packs/original/snip/frame-snip:1606
msgid "Couldn't take a snip"
msgstr ""
#: packs/original/snip/frame-snip:1601
#: packs/original/snip/frame-snip:1609
msgid "empty picture"
msgstr ""
@@ -3450,7 +3450,7 @@ msgstr ""
msgid "Put the snip's image on the clipboard"
msgstr ""
#: packs/original/snip/frame-snip:684 packs/original/snip/frame-snip:1305
#: packs/original/snip/frame-snip:684 packs/original/snip/frame-snip:1313
msgid "Copy text"
msgstr ""
+3 -1
View File
@@ -415,7 +415,9 @@ class OverlayHost:
self.pad.release_all_mods()
self.pad.restyle()
self.visible = visible
grips = self.grips.poll() if (self.grips and visible) else []
# (only while a laser is on the pad, or it's carried by the grip: each read asks SteamVR
# for controller properties, which other programs wait on too)
grips = self.grips.poll() if (self.grips and visible and (self.hovered_devices or self.grip_drag)) else []
self.gripping = {d for d, held, _ in grips if held}
for d, held, pressed in grips:
# Squeeze while that controller's laser is on the pad: grab it (keys included).
+11 -3
View File
@@ -996,7 +996,10 @@ class NarrationOverlay(QObject):
self.n, self.last_digest, self.cover_path, self.pressed, self.drag = 0, None, None, None, None
self.render()
self.ov.showOverlay(self.h)
QTimer(self, interval=22, timeout=self.poll).start()
# Events 45x a second while a laser is on the panel (or it's carried or pressed), 10x
# otherwise (only to notice one arriving; nothing is lost meanwhile: events queue)
self.poll_timer = QTimer(self, interval=22, timeout=self.poll)
self.poll_timer.start()
QTimer(self, interval=200, timeout=self.render).start()
def size_m(self):
@@ -1233,8 +1236,9 @@ class NarrationOverlay(QObject):
self.drag = None
self.save_offset() # remembered relative to the dashboard
# Grip to carry it, as on Arrow Pad and Full Keyboard: squeeze while that controller's
# laser is on the panel (buttons included), let go to put it down.
grips = self.grips.poll() if self.grips else []
# laser is on the panel (buttons included), let go to put it down. (Read only then: each
# read asks SteamVR for controller properties, which other programs wait on too.)
grips = self.grips.poll() if self.grips and (self.hovered or self.grip_drag) else []
held = {d for d, h, _ in grips if h}
for d, _, pressed in grips:
if pressed and d in self.hovered and self.drag is None:
@@ -1252,6 +1256,10 @@ class NarrationOverlay(QObject):
if ctrl is not None:
self.pose = vrkit.rigid_mul(ctrl, self.drag[1])
self.apply_pose()
busy = self.hovered or self.drag is not None or self.pressed is not None
timer = getattr(self, "poll_timer", None)
if timer is not None and timer.interval() != (22 if busy else 100):
timer.setInterval(22 if busy else 100)
def haptic(self, dev, kind):
"""A tick on the controller pointing at a button, a firmer one on a press (Arrow Pad's and