mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
fix(input): release a mouse Back right click on focus loss and pass nav Back through
Address review: a navigation-bar Back that arrives while an injected mouse Back is held now stays Back instead of releasing the right button early. A held right button is released on pause, focus loss and input-device removal, like the other held Back handling. While the session is suspended or still loading, Back is no longer sent to the guest.
This commit is contained in:
1 parent
57b3623a9a
commit
abb28792e8
3 files changed
+32
-3
No files matched your search
@@ -588,6 +588,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
Log.i(TAG, "input device $deviceId disconnected")
|
||||
dropMouseCursor()
|
||||
backQamInput.onDeviceRemoved(deviceId)
|
||||
mouseBackInput.cancel()
|
||||
joyConVr?.refresh()
|
||||
padBridge?.onDeviceRemoved(deviceId)
|
||||
if (::padMouse.isInitialized) padMouse.reset()
|
||||
@@ -2584,7 +2585,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
event.deviceId, event.device?.name, event.source, event.flags))
|
||||
}
|
||||
val mouseToGuest = !pipUi && !drawerOpen && !pcKeyboardOpen && !achievementsOpen && !gestureSettingsOpen &&
|
||||
!(::loading.isInitialized && loading.ended)
|
||||
!SessionState.suspended && !(::loading.isInitialized && (loading.visible || loading.ended))
|
||||
if (mouseBackInput.onKeyEvent(event, mouseToGuest)) return true
|
||||
val backToQam = !pipUi && !screenKeyTextFocus && !drawerOpen && !pcKeyboardOpen && !achievementsOpen &&
|
||||
SessionState.mode == SessionService.MODE_STEAM && SessionState.running && SessionState.firstFrameSeen &&
|
||||
@@ -4372,6 +4373,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
if (runtimeRemovalBlocked) { super.onPause(); return }
|
||||
physicalShortcuts.clear()
|
||||
backQamInput.cancel()
|
||||
mouseBackInput.cancel()
|
||||
capturePausedFrame()
|
||||
sessionClipboard.stop()
|
||||
if (::touchscreenGestures.isInitialized) touchscreenGestures.cancel()
|
||||
@@ -4933,6 +4935,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
super.onWindowFocusChanged(hasFocus)
|
||||
if (!hasFocus) com.droiddeck.launcher.input.HomeButtonShortcuts.cancel(this)
|
||||
if (!hasFocus) backQamInput.cancel()
|
||||
if (!hasFocus) mouseBackInput.cancel()
|
||||
if (!hasFocus && ::padMouse.isInitialized) padMouse.reset()
|
||||
if (runtimeRemovalBlocked) return
|
||||
if (!hasFocus) {
|
||||
|
||||
Reference in new issue
Block a user