Conversation
…in consolemode, harden disabled control options
| useGamepadComboHold([BTN_SELECT, BTN_R2], (held) => { | ||
| if (held) { | ||
| // Surface Heroic during the countdown | ||
| window.api.focusMainWindow() |
There was a problem hiding this comment.
This listener is mounted at the root for the whole non-console app and fires focusMainWindow on the very first frame View+R2 is seen, not after the 3s hold. When a game was launched from the normal Library and Heroic is in the background, a momentary View tap while holding RT (common for map/aim in many games) will restore/show/focus Heroic over the fullscreen game, and on Plasma Wayland force-activate it via KWin.
gamepad.ts already gates its own input handling on isFocused for exactly this reason (Chromium keeps delivering gamepad state to unfocused windows). useGamepadComboHold has no such gate, so please either require document.hasFocus() / the existing focus flag before starting the hold, or only call focusMainWindow once the hold actually completes.
| const comboKey = buttonIndices.join(',') | ||
|
|
||
| useEffect(() => { | ||
| if (!enabled) return |
There was a problem hiding this comment.
useGamepadButtonPress and useGamepadButtonHold were updated to respect isControllerNavDisabled(), but useGamepadComboHold and isGamepadButtonHeld don't check it. With disableController=true and the new setting off, A/B/L1/R1/R2 are correctly dead but View+RT still enters console mode from anywhere, quits console mode, and kills a playing game via the LaunchOverlay combo. Same guard as the sibling hooks should be enough.
There was a problem hiding this comment.
The Idea behind this, was to still allow the console-mode even if controller Navigation is disabled. Argueably this does not navigate here, and still enables Console-Mode, which also has Controller support enabled by default. This would drop my intended behaviour.... Do we still apply it your way?
There was a problem hiding this comment.
I could also put that in a condition that if the controller is enabled by default in console-mode, this would also enable the start of console-mode with the View+RT, and if it's off, it wouldn't
There was a problem hiding this comment.
OK, makes sense then lets keep as it is.
| } | ||
|
|
||
| // KWin denies focus stealing on Wayland | ||
| export async function kwinActivateWindow(caption: string): Promise<void> { |
There was a problem hiding this comment.
This fallback can't work in the Flatpak build, which is the main Plasma Wayland / Steam Deck desktop target it's aimed at: qdbus/qdbus6 are exec'd inside the sandbox (the runtime is org.freedesktop.Platform, no qdbus, so ENOENT), the manifest has no --talk-name=org.kde.KWin, and the script is written to sandbox-private temp that host KWin can't read. Both spawns fail, main.ts swallows the error, and nothing is logged.
It would need flatpak-spawn --host plus the D-Bus permission and a host-visible script path, or alternatively just skip the fallback when running in Flatpak and log that.
There was a problem hiding this comment.
I'd rather just log it, as I do not use flatpak at all, and I have little incentive for the use of flatpak builds...
There was a problem hiding this comment.
ok add a TODO and check if flatpak you log it.
… consolemode controller enable
Fixes: #5520
Fixes: #5577
Fixes: #5541
Note:
Changed Close-Combo to View + R2
This should be possible to edit for the user in the future. Seperate PR
Starting Console mode now is also: View + R2 for 3s
Focuses Heroic with: View + R2 on Wayland & KDE Desktops
Hardened Disabled control options in console mode. Now only View + R2 works (close)
Added override config option in Settings.
Use the following Checklist if you have changed something on the Backend or Frontend: