mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 06:15:58 +00:00
feat(display): zero-copy presentation toggle and compositor display buffers (#2905)
* feat(display): zero-copy presentation toggle and compositor display buffers Adds a Zero-copy presentation switch under Steam Settings, Display, Session Display (on by default), and a display-buffer allocator in the compositor: a Vulkan driver that states displayBuffers asks it for the memory of the images it exports, so frames presented through the nested compositor are gralloc buffers that go on the display layer without a copy. Compressed buffers are offered only where the device's allocator matches the layout the drivers render to; everything else stays on the copy path. The private buffer protocol is renamed to droiddeck-ahb-v1. * fix(display): zero-copy frames keep the full refresh rate Two buffers set on the game layer inside one refresh replaced each other, and a frame that slipped into the next refresh made the compositor hold and drop the on-time frame behind it. The layer now queues buffers, and a refresh takes a second frame when the one before it took none. The pacing tool no longer counts its dump time in the frame rate. * Keep cropped scenes on the display layer and pace layer frames evenly Accept any in-bounds source crop for the display layer and map the draw geometry the same way the copy path does. Time layer frames against the display's frame timeline, and when the game's rate is a steady whole fraction of the refresh rate show each frame a fixed number of refreshes after the last so uneven arrivals no longer reach the screen. * List zero-copy in the settings map * Hold display buffers until the display releases them A buffer the game or gamescope rendered straight into went back to its client as soon as the next one was latched, with the display's release fence attached to the dma-buf. The KGSL driver does not wait on that fence, so the client could draw into a buffer the panel was still reading. Display buffers now wait for the release fence before the release event, and gamescope composites only into output images the host has released. * Keep the game picture copy-free when an overlay has no display layer When the display cannot give a second layer of its own to an overlay, the compositor tells gamescope how many planes it can show directly. gamescope then composes its overlays into the game picture, which still reaches the display without a copy. * feat(session): the panel refresh rate follows the session's frame rate The session learns the panel's refresh rates and reports the refresh rate and frame rate it wants. The panel moves to the highest rate the frame rate divides evenly, frame generation counts at its output rate, and a panel whose rate the system holds offers only that rate. * feat(session): the panel follows a frame rate the game holds on its own The compositor reports the game's frame rate once a second. A rate that holds for three seconds and divides a panel rate becomes the content rate when neither the app's limit nor the session's limiter is setting the pace, so a game capped in its own settings gets a panel rate its frames divide into. A rate that was dropped has to hold twice as long before it is used again. * Show generated frames on the game's display layer With frame generation on, the game's own frames stay on their display layer untouched and each generated frame is placed on the same layer between them, timed across the game's frame interval. The compositor pass is kept when effects, HDR routing or a cursor need it, or when the panel cannot show the multiplied rate. * Keep scaling, generated frames and HDR on the display layer A scaler or frame generation with zero-copy on now draws once into the display layer instead of falling back to the copied surface. HDR output goes to the layer when the panel supports it; on a panel without HDR the picture is tone-mapped on the same path, and the toggle is labelled to match what the panel can do. * Spread a frame limit the refresh rate does not divide evenly across refreshes * Cover the spare-tick and panel-rate paths in the compositor source tests * Pin the gamescope build with the display-plane, release, refresh and limiter patches * Give the layer and terminal-caller harnesses the black fill state they compile against * feat(display): switch HDR during a session without restarting the app The compositor now offers HDR whenever the device can present it, and the HDR setting only decides whether the session uses it. Both HDR switches set gamescope's hdr_enabled, the compositor's HDR output and zero-copy for the running session. gamescope patch 0139 lets hdr_enabled change after start. The 'Restart the app to apply.' hint is removed from every locale. * Remake the output images in the new format when HDR is switched during a session * Pin the gamescope build that switches HDR during a session * Apply a saved HDR opt-out at session start and keep HDR retries with their session * Serialise the HDR output switch with the gate opening * feat(display): keep the client's HDR setting and the session's in step The session publishes its HDR state with the other device controls and the client helper applies it to the client's own display setting. A change made in the client is reported back and goes through the same switch the drawer and Session Display use, so all three always show one value. * fix(desktop): keep the display-buffer socket when the runtime directory is cleared The desktop launcher removed everything in the runtime directory except the compositor's Wayland socket, which took the display-buffer socket with it, so no desktop program could ask for display buffers and every frame was copied. * fix(display): the client's HDR setting follows the session in every client mode The bridge only ran when a variable nothing sets was present, so the client's HDR setting and the session's never met. It now runs whenever the session publishes an HDR state, and a client that has no such setting is asked again only every ten seconds. * fix(display): harden display-buffer hand-off, layer fallbacks and HDR sync - Stop closing a buffer handle's descriptor the allocator still owns, and free an allocation whose reply could not be sent. - Rebuild the advertised buffer formats when zero-copy is switched during a session. - Fall back to the copy path when a layer buffer cannot be allocated, and hide the game layer when it is skipped for a frame. - Keep a release fence that has not signalled instead of rendering into a buffer the display still reads. - Ignore a refresh-target reset from a client that does not own the target. - Restart the content-rate measurement after a pause, clear it when the game stops, and lengthen engagement only for a rate that was released before. - Compare colour conversions by their values, and read padded cursor buffers at their row width. - Use the running session's mode for the HDR and zero-copy settings, probe the display before screen effects are pushed, retry a held panel mode, and ignore callbacks after the activity is destroyed. - Write a newer HDR value while an earlier write is settling, and reapply the value after the bridge is reinstalled.
This commit is contained in:
1 parent
f29f72d5d9
commit
4349563fd1
101 files changed
+3927
-624
No files matched your search
@@ -109,6 +109,7 @@ import com.droiddeck.launcher.input.TouchpadGestures
|
||||
import com.droiddeck.launcher.input.TouchscreenGestures
|
||||
import com.droiddeck.launcher.input.ScrollTouchGestures
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.ContentCadence
|
||||
import com.droiddeck.launcher.session.LoadingState
|
||||
import com.droiddeck.launcher.hud.DroidDeckHudConfig
|
||||
import com.droiddeck.launcher.hud.DroidDeckHudHost
|
||||
@@ -306,7 +307,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private var directHoldBehavior by mutableStateOf(com.droiddeck.launcher.input.TouchGestureConfig.MOUSE_BEHAVIOR_CLICK)
|
||||
private var relativeMouseMode by mutableIntStateOf(0)
|
||||
@Volatile private var appliedRelativeMouseMode: Int? = null
|
||||
private val agentReadyListener: () -> Unit = { relativeMouseRetries = 0; requestRelativeMouse() }
|
||||
private val agentReadyListener: () -> Unit = {
|
||||
relativeMouseRetries = 0
|
||||
requestRelativeMouse()
|
||||
appliedOverlayPlanes = null
|
||||
overlayPlanesRetries = 0
|
||||
requestOverlayPlanes()
|
||||
}
|
||||
private val appTextFocus get() = wowChat.request != null
|
||||
private val wowChat by lazy { com.droiddeck.launcher.ui.WowChat(this, ::sendWowChat, ::cancelWowChat, ::readGameField) }
|
||||
private var wowChatBottom: SecondScreenPresentation? = null
|
||||
@@ -510,6 +517,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private fun fpsLimitKey(): String? = if (SessionState.running) SessionPrefs.fpsLimitKey(SessionState.mode, SessionState.gameId)
|
||||
else SessionPrefs.fpsLimitKey(intent.getStringExtra(SessionService.EXTRA_MODE), intent.getStringExtra(SessionService.EXTRA_GAME_ID))
|
||||
private var blackFrameInsertion by mutableStateOf(false)
|
||||
private var hdrWanted by mutableStateOf(false)
|
||||
private var hdrAvailable by mutableStateOf(false)
|
||||
|
||||
private fun noSteamSession(): Boolean = (SessionState.mode == SessionService.MODE_RUN &&
|
||||
SessionState.program in setOf(
|
||||
@@ -610,6 +619,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
syncActiveScreenEffectsProfile()
|
||||
}
|
||||
}
|
||||
private val hdrPrefListener = android.content.SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
|
||||
if (key == SessionPrefs.hdrKey(hdrPrefMode())) uiHandler.post { hdrWanted = SessionPrefs.hdr(this, hdrPrefMode()) }
|
||||
}
|
||||
private val shortcutPrefListener = android.content.SharedPreferences.OnSharedPreferenceChangeListener { _, key ->
|
||||
if (key == null || key == PhysicalShortcuts.KEY) {
|
||||
physicalShortcuts.bindings = PhysicalShortcuts.read(this)
|
||||
@@ -1038,6 +1050,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
updateOnScreenControls()
|
||||
WaylandCompositor.setFirstFrameListener(firstFrameListener)
|
||||
WaylandCompositor.setPointerLockListener(pointerLockListener)
|
||||
WaylandCompositor.setOverlayPlanesListener(overlayPlanesListener)
|
||||
WaylandCompositor.setRefreshTargetListener(refreshTargetListener)
|
||||
WaylandCompositor.setContentRateListener(contentRateListener)
|
||||
SessionEvents.markReadyIfPossible()
|
||||
SessionState.endListener = endListener
|
||||
onBackPressedDispatcher.addCallback(this, object : OnBackPressedCallback(true) {
|
||||
@@ -1645,6 +1660,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
blackFrameInsertion = on
|
||||
CompositorHost.setBlackFrameInsertion(on, refreshHz(), outputFpsLimit())
|
||||
},
|
||||
hdr = hdrWanted,
|
||||
hdrAvailable = hdrAvailable,
|
||||
onHdr = { on -> com.droiddeck.launcher.session.SessionHdr.set(this@SessionActivity, hdrPrefMode(), on); hdrWanted = on },
|
||||
onFrameGenPick = { mode ->
|
||||
val appId = frameGenTargetGameId()
|
||||
|
||||
@@ -2492,6 +2510,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
hudOn = SessionPrefs.hudEnabled(this)
|
||||
gpuClockPin = gpuClockHeld()
|
||||
blackFrameInsertion = SessionPrefs.blackFrameInsertion(this)
|
||||
hdrWanted = SessionPrefs.hdr(this, hdrPrefMode())
|
||||
hdrAvailable = HdrSupport.probe(this, glassesScreen?.display).reason == null
|
||||
hudConfig = DroidDeckHudConfig.load(this)
|
||||
hudColor = SessionPrefs.hudColor(this)
|
||||
hudOpacity = SessionPrefs.hudOpacity(this)
|
||||
@@ -2747,6 +2767,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
.onFailure { Log.e(TAG, "Could not update game environment", it) }
|
||||
}, "game-env-publish").start()
|
||||
applyGameAlignment()
|
||||
val attached = CompositorHost.isStarted
|
||||
val probe = if (attached) null else HdrSupport.probe(this, glassesScreen?.display)
|
||||
if (probe != null) SessionState.hdrDisplay = probe.reason == null
|
||||
val activeProfileId = currentScreenEffectsProfileId()
|
||||
val activeUpscaler = SessionPrefs.screenEffectsUpscaler(this, activeProfileId)
|
||||
val activeEffects = SessionPrefs.screenEffects(this, activeProfileId)
|
||||
@@ -2766,27 +2789,31 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
Log.w(TAG, "could not point the compositor's log at $waylandLog", e)
|
||||
}
|
||||
}
|
||||
if (!CompositorHost.isStarted) {
|
||||
val mode = SessionPrefs.prefMode(intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM)
|
||||
val probe = HdrSupport.probe(this, glassesScreen?.display)
|
||||
val mode = hdrPrefMode()
|
||||
if (probe != null) {
|
||||
WaylandCompositor.nativeSetHdrDisplay(
|
||||
probe.displayId, probe.name, probe.formats, probe.hdr10,
|
||||
probe.maxLuminance, probe.maxAverageLuminance, probe.minLuminance,
|
||||
probe.ratioAvailable, probe.ratio, Build.VERSION.SDK_INT,
|
||||
)
|
||||
val wanted = SessionPrefs.hdr(this, mode)
|
||||
val on = wanted && probe.reason == null
|
||||
SessionState.hdr = on
|
||||
if (on) {
|
||||
val capable = HdrSupport.blocked(this) == null
|
||||
val tonemap = capable && probe.reason != null
|
||||
SessionState.hdrCapable = capable
|
||||
if (capable) {
|
||||
try { android.system.Os.setenv("DROIDDECK_WAYLAND_HDR", "1", true) } catch (e: Exception) { Log.w(TAG, "DROIDDECK_WAYLAND_HDR", e) }
|
||||
WaylandCompositor.nativeSetZeroCopy(true)
|
||||
}
|
||||
WaylandCompositor.nativeSetHdrRequest(
|
||||
if (on) WaylandCompositor.HDR_MODE_ON else WaylandCompositor.HDR_MODE_OFF,
|
||||
"$mode session settings" + (if (wanted && !on) " (refused: ${probe.reason})" else ""),
|
||||
on, on,
|
||||
if (tonemap) WaylandCompositor.HDR_MODE_TONEMAP else if (capable) WaylandCompositor.HDR_MODE_ON else WaylandCompositor.HDR_MODE_OFF,
|
||||
"$mode session settings", capable, false,
|
||||
)
|
||||
Log.i(TAG, "hdr: " + (if (on) "on" else if (wanted) "wanted but ${probe.reason}" else "off") + " · display ${probe.formats.ifEmpty { "SDR" }}")
|
||||
Log.i(TAG, "hdr: " + (if (tonemap) "tone-mapped (${probe.reason})" else if (capable) "available" else "unavailable") + " · display ${probe.formats.ifEmpty { "SDR" }}")
|
||||
}
|
||||
if (!SessionState.running) {
|
||||
val on = SessionState.hdrCapable && SessionPrefs.hdr(this, mode)
|
||||
SessionState.hdr = on
|
||||
WaylandCompositor.nativeSetHdrOutput(on)
|
||||
WaylandCompositor.nativeSetZeroCopy(on || SessionPrefs.zeroCopy(this, mode))
|
||||
Log.i(TAG, "hdr: " + (if (on) "on" else "off") + " for this $mode session")
|
||||
}
|
||||
com.droiddeck.launcher.gpu.DriverSetupLog.write(this, "compositor.start driver=$driverId")
|
||||
CompositorHost.startOrAttach(
|
||||
@@ -2962,6 +2989,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
return if (capped > 1f) capped else 60f
|
||||
}
|
||||
|
||||
private fun hdrPrefMode(): String = SessionPrefs.prefMode(
|
||||
if (SessionState.running) SessionState.mode
|
||||
else intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM,
|
||||
)
|
||||
|
||||
private fun blackFrameInsertionAvailable(): Boolean {
|
||||
// Glasses that present the game run at their own rate, uncapped, as refreshHz() reads them.
|
||||
glassesScreen?.display?.let { glasses ->
|
||||
@@ -2981,9 +3013,38 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private fun outputFpsLimit(pip: Boolean): Int =
|
||||
SessionPrefs.compositorFpsLimit(mirrorRefreshLimit(), if (noSteamSession()) SessionState.fpsLimit else 0, pip)
|
||||
|
||||
private var panelHeld = false
|
||||
private val panelHeldCheck = Runnable {
|
||||
if (!panelHeld && hasWindowFocus() && PerfMode.panelHeld(this)) {
|
||||
panelHeld = true
|
||||
uiHandler.removeCallbacks(panelHeldRetry)
|
||||
uiHandler.postDelayed(panelHeldRetry, PANEL_HELD_RETRY_MS)
|
||||
applyOutputPacing()
|
||||
}
|
||||
}
|
||||
private val panelHeldRetry = Runnable {
|
||||
if (panelHeld && !isDestroyed) {
|
||||
panelHeld = false
|
||||
applyOutputPacing()
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyOutputPacing() {
|
||||
Log.i(TAG, "perf: " + PerfMode.apply(this, outputFpsLimit(false), mirrorRefreshLimit()))
|
||||
val frameGen = appliedFrameGenMode
|
||||
pacedFrameGenMode = frameGen
|
||||
val ownLimit = outputFpsLimit(false)
|
||||
val content = PerfMode.contentRate(
|
||||
PerfMode.pacedRate(ownLimit, guestFrameRate, guestRefresh, contentCadence.rate),
|
||||
frameGen?.outputFactor ?: 1, frameGen?.target ?: 0,
|
||||
)
|
||||
Log.i(TAG, "perf: " + PerfMode.apply(this, content, mirrorRefreshLimit(), if (ownLimit > 0) 0 else guestRefresh, panelHeld))
|
||||
uiHandler.removeCallbacks(panelHeldCheck)
|
||||
if (!panelHeld) uiHandler.postDelayed(panelHeldCheck, PANEL_HELD_CHECK_MS)
|
||||
if (CompositorHost.isStarted) {
|
||||
WaylandCompositor.nativeSetPanelRates(
|
||||
if (glassesScreen == null && !bottomOutputActive) PerfMode.panelRates(this, mirrorRefreshLimit(), panelHeld)
|
||||
else IntArray(0),
|
||||
)
|
||||
val hz = refreshHz()
|
||||
val changed = kotlin.math.abs(SessionState.refreshHz - hz) > 0.1f
|
||||
CompositorHost.updatePacing(hz, outputFpsLimit())
|
||||
@@ -3149,6 +3210,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (frameGenActivityGeneration != frameGenGlobalGeneration.get()) return@runOnUiThread
|
||||
lossless = state
|
||||
if (problem != null) Toast.makeText(this, problem, Toast.LENGTH_LONG).show()
|
||||
if (appliedFrameGenMode != pacedFrameGenMode) applyOutputPacing()
|
||||
}
|
||||
}, "frame-gen").start()
|
||||
}
|
||||
@@ -3749,8 +3811,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
|
||||
|
||||
private val relativeMouseRequests = java.util.concurrent.Executors.newSingleThreadExecutor { runnable ->
|
||||
Thread(runnable, "relative-mouse").apply { isDaemon = true }
|
||||
private val gamescopeConvarRequests = java.util.concurrent.Executors.newSingleThreadExecutor { runnable ->
|
||||
Thread(runnable, "gamescope-convar").apply { isDaemon = true }
|
||||
}
|
||||
@Volatile private var desiredRelativeMouseMode = 0
|
||||
|
||||
@@ -3763,7 +3825,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
|
||||
private fun requestRelativeMouse() {
|
||||
runCatching { relativeMouseRequests.execute { applyRelativeMouse() } }
|
||||
runCatching { gamescopeConvarRequests.execute { applyRelativeMouse() } }
|
||||
}
|
||||
|
||||
private fun applyRelativeMouse() {
|
||||
@@ -3777,23 +3839,58 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
)) == com.droiddeck.launcher.input.TouchRouter.Route.TOUCHPAD
|
||||
val mode = com.droiddeck.launcher.input.TouchGestureConfig.gamescopeRelativeMouse(wanted, mouseAttached(), touchpadRoute)
|
||||
if (appliedRelativeMouseMode == mode) return
|
||||
val request = org.json.JSONObject()
|
||||
.put("kind", "exec")
|
||||
.put("argv", org.json.JSONArray(listOf("gamescopectl", "relative_mouse", mode.toString())))
|
||||
.put("timeout", 5.0)
|
||||
val result = runCatching { AgentGuest.call(this, request, 8_000, trusted = true) }
|
||||
val answer = result.getOrNull()
|
||||
val applied = answer?.optBoolean("ok") == true
|
||||
&& answer.optInt("exitCode", -1) == 0
|
||||
&& !answer.optBoolean("timedOut")
|
||||
if (applied) appliedRelativeMouseMode = mode
|
||||
else {
|
||||
Log.w(TAG, "gamescope did not take relative mouse $mode: ${result.exceptionOrNull() ?: answer}")
|
||||
if (relativeMouseRetries++ < RELATIVE_MOUSE_MAX_RETRIES) uiHandler.postDelayed({ requestRelativeMouse() }, 2_000)
|
||||
}
|
||||
if (AgentGuest.setGamescopeConvar(this, "relative_mouse", mode)) appliedRelativeMouseMode = mode
|
||||
else if (relativeMouseRetries++ < RELATIVE_MOUSE_MAX_RETRIES) uiHandler.postDelayed({ requestRelativeMouse() }, 2_000)
|
||||
if (desiredRelativeMouseMode != wanted) requestRelativeMouse()
|
||||
}
|
||||
|
||||
@Volatile private var desiredOverlayPlanes = -1
|
||||
@Volatile private var appliedOverlayPlanes: Int? = -1
|
||||
@Volatile private var overlayPlanesRetries = 0
|
||||
@Volatile private var guestRefresh = 0
|
||||
@Volatile private var guestFrameRate = 0
|
||||
private var pacedFrameGenMode: FrameGen.Mode? = null
|
||||
private val contentCadence = ContentCadence()
|
||||
private val contentRateListener = WaylandCompositor.ContentRateListener { fps ->
|
||||
runOnUiThread {
|
||||
if (isDestroyed) return@runOnUiThread
|
||||
val changed = if (fps > 0) contentCadence.note(fps, PerfMode.panelRates(this, mirrorRefreshLimit(), panelHeld))
|
||||
else contentCadence.reset()
|
||||
if (changed) {
|
||||
Log.i(TAG, "perf: steady content rate " + contentCadence.rate + " fps")
|
||||
applyOutputPacing()
|
||||
}
|
||||
}
|
||||
}
|
||||
private val refreshTargetListener = WaylandCompositor.RefreshTargetListener { refresh, frameRate ->
|
||||
runOnUiThread {
|
||||
if (isDestroyed) return@runOnUiThread
|
||||
if (guestRefresh != refresh || guestFrameRate != frameRate) {
|
||||
guestRefresh = refresh
|
||||
guestFrameRate = frameRate
|
||||
applyOutputPacing()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val overlayPlanesListener = WaylandCompositor.OverlayPlanesListener { planes ->
|
||||
desiredOverlayPlanes = planes
|
||||
overlayPlanesRetries = 0
|
||||
requestOverlayPlanes()
|
||||
}
|
||||
|
||||
private fun requestOverlayPlanes() {
|
||||
runCatching { gamescopeConvarRequests.execute { applyOverlayPlanes() } }
|
||||
}
|
||||
|
||||
private fun applyOverlayPlanes() {
|
||||
val wanted = desiredOverlayPlanes
|
||||
if (appliedOverlayPlanes == wanted) return
|
||||
if (AgentGuest.setGamescopeConvar(this, "wayland_overlay_planes", wanted)) appliedOverlayPlanes = wanted
|
||||
else if (overlayPlanesRetries++ < RELATIVE_MOUSE_MAX_RETRIES) uiHandler.postDelayed({ requestOverlayPlanes() }, 2_000)
|
||||
if (desiredOverlayPlanes != wanted) requestOverlayPlanes()
|
||||
}
|
||||
|
||||
private fun refreshGestureConfig() {
|
||||
gestureConfig = com.droiddeck.launcher.input.GesturePrefs.read(this, gestureGame)
|
||||
directHoldBehavior = gestureConfig.directHoldBehavior
|
||||
@@ -5754,6 +5851,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
updatePadMotion()
|
||||
ControllerPrefs.prefs(this).registerOnSharedPreferenceChangeListener(shortcutPrefListener)
|
||||
SessionPrefs.sessionPrefs(this).registerOnSharedPreferenceChangeListener(screenEffectsProfilePrefListener)
|
||||
SessionPrefs.sessionPrefs(this).registerOnSharedPreferenceChangeListener(hdrPrefListener)
|
||||
observedScreenEffectsProfileId = SessionPrefs.activeScreenEffectsProfileId(this)
|
||||
readPrefs()
|
||||
observedScreenEffectsProfileId = SessionPrefs.activeScreenEffectsProfileId(this)
|
||||
@@ -5824,6 +5922,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
hidePrimaryKeyboard()
|
||||
pendingFieldKeyboard = pendingKeyboard
|
||||
SessionPrefs.sessionPrefs(this).unregisterOnSharedPreferenceChangeListener(cardboardPrefListener)
|
||||
SessionPrefs.sessionPrefs(this).unregisterOnSharedPreferenceChangeListener(hdrPrefListener)
|
||||
SessionPrefs.sessionPrefs(this).unregisterOnSharedPreferenceChangeListener(screenEffectsProfilePrefListener)
|
||||
ControllerPrefs.prefs(this).unregisterOnSharedPreferenceChangeListener(shortcutPrefListener)
|
||||
updateHeadTracker()
|
||||
@@ -6438,6 +6537,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
uiHandler.removeCallbacks(panelHeldCheck)
|
||||
uiHandler.removeCallbacks(panelHeldRetry)
|
||||
synchronized(frameGenGlobalLock) {
|
||||
frameGenActivityActive = false
|
||||
frameGenRequests.incrementAndGet()
|
||||
@@ -6445,7 +6546,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (AgentGuest.readyListener === agentReadyListener) AgentGuest.readyListener = null
|
||||
if (com.droiddeck.launcher.agent.AgentAttachments.gameFrame === gameFrame) com.droiddeck.launcher.agent.AgentAttachments.gameFrame = null
|
||||
com.droiddeck.launcher.input.HomeButtonShortcuts.detach(this)
|
||||
relativeMouseRequests.shutdownNow()
|
||||
gamescopeConvarRequests.shutdownNow()
|
||||
backQamInput.cancel()
|
||||
steamVrRecovery.close()
|
||||
uiHandler.removeCallbacks(steamTouchRetry)
|
||||
@@ -6488,6 +6589,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (SessionState.endListener === endListener) SessionState.endListener = null
|
||||
WaylandCompositor.clearFirstFrameListener(firstFrameListener)
|
||||
WaylandCompositor.clearPointerLockListener(pointerLockListener)
|
||||
WaylandCompositor.clearOverlayPlanesListener(overlayPlanesListener)
|
||||
WaylandCompositor.clearRefreshTargetListener(refreshTargetListener)
|
||||
WaylandCompositor.clearContentRateListener(contentRateListener)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@@ -6562,6 +6666,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
const val EXTRA_STEAMVR = "steamVr"
|
||||
const val EXTRA_PLAYED_GAME = "com.droiddeck.launcher.PLAYED_GAME"
|
||||
const val EXTRA_REPAIR_RUNTIME = "repairRuntime"
|
||||
private const val PANEL_HELD_CHECK_MS = 2_500L
|
||||
private const val PANEL_HELD_RETRY_MS = 60_000L
|
||||
private const val LEAVE_TIMEOUT_MS = 1_500L
|
||||
private const val TEXT_FIELD_TAP_MS = 1_000L
|
||||
private const val PAUSED_FRAME_MAX_EDGE = 1920f
|
||||
|
||||
Reference in new issue
Block a user