Skip to content

Conversation

@JeodC
Copy link
Contributor

@JeodC JeodC commented Jan 2, 2026

On multi-seat/dual-screen devices (like the AYN Thor), games using Wayland (vs xWayland) lose all input from gptokeyb upon entering fullscreen or during workspace migration.

This happens because the newer sway versions enforce strict seat-ownership. When a window changes state to fullscreen or moves between outputs (DSI-1 to DSI-2), Sway may revoke access to input devices that are not explicitly "trusted" or "attached" to the active seat. Since gptokeyb fake input devices are created dynamically, they land on a default seat that doesn't match the seat where the game window is currently focused.

To resolve this, modify portmaster_sway_fullscreen.sh to perform a "handshake" of input devices the moment a game is launched and fullscreened.

seat seat1 attach "*" - This forces all available input devices (physical and virtual) to be attached to the active game seat. This prevents "Focus Revocation," ensuring the game can see the virtual keyboard immediately after the fullscreen transition.

seat * keyboard_grouping smart - This unifies the virtual input nodes across all seats. This is critical for dual-screen users; it prevents the game from crashing or losing input when a hotkey is used to swap the game workspace between the top and bottom screens.

Test method used below, can be tested without rebuilding rocknix.

cp /usr/bin/portmaster_sway_fullscreen.sh /storage/portmaster_sway_fullscreen.sh
nano /storage/portmaster_sway_fullscreen.sh
mount --bind /storage/portmaster_sway_fullscreen.sh /usr/bin/portmaster_sway_fullscreen.sh
cat /usr/bin/portmaster_sway_fullscreen.sh

…he active game seat to prevent wayland focus revocation, and unify virtual input nodes.

This prevents sway from losing gptokeyb uinput when it's fullscreened and retains the screen swapping toggle on dual screen devices.
@JeodC
Copy link
Contributor Author

JeodC commented Jan 2, 2026

I am not sure if it's related, but the touchscreen keyboard does not send button inputs to a game. Before the above fix though, the keyboard didn't respond at all--now when I tap keys on it they light up at the least.

@JeodC
Copy link
Contributor Author

JeodC commented Jan 5, 2026

This sway input permissions thing may affect other emulators like drastic and azahar. If so then the commit may not be the correct solution. Please review discussion in the Discord server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant