Repository navigation
Conversation
On the Steam Deck, opening the Steam menu over Hydra made the controller drive both at once: the selection moved in the Steam menu and in Hydra underneath. requestAnimationFrame throttles when a window is hidden, so polling would normally pause on its own. That does not happen here because the Steam overlay draws on top of the window without hiding it, so frames keep being delivered and the app keeps consuming input it can no longer act on. Gate the polling on window focus instead. The frame loop keeps being scheduled so input resumes by itself, and losing focus clears pending timers and accepted inputs the same way setInputEnabled(false) already does -- otherwise a button held at that moment would keep its repeat timer alive in the background. The flag is separate from inputEnabled on purpose: that one is owned by navigation-input.provider, and reusing it would let a focus event re-enable input the provider had deliberately turned off.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR interno no fork, aberto só para o CI gerar o AppImage e permitir teste no Steam Deck antes de propor ao upstream.
Sintoma
Com o Hydra aberto no Gaming Mode, apertar o botão que abre o menu lateral da Steam faz o controle comandar os dois ao mesmo tempo: a seleção anda no menu da Steam e dentro do Hydra, atrás.
Causa
O
requestAnimationFramenormalmente pausa quando a janela fica oculta, então o polling pararia sozinho. Isso não acontece aqui porque o overlay da Steam desenha por cima da janela sem ocultá-la — os frames continuam chegando e o app segue consumindo input que já não deveria receber.Correção
Condiciona o polling ao foco da janela. O loop continua sendo agendado, então o input volta sozinho ao recuperar o foco.
Detalhes de implementação:
inputEnabled, que pertence aonavigation-input.provider. Reutilizá-lo deixaria um evento defocusreligar input que o provider tinha desligado de propósito.blur, limpa timers e entradas aceitas — a mesma limpeza quesetInputEnabled(false)já fazia. Sem isso, um botão segurado no momento em que a janela perde o foco manteria o timer de repetição vivo em segundo plano.document.hasFocus(), porque a janela pode nascer em segundo plano.Como testar
Verificações
tsc --noEmit -p tsconfig.web.json— sem errosprettier --check— okeslint— sem avisos