From 2d3de206825fee5653ce0785c7455e4d0609a47e Mon Sep 17 00:00:00 2001 From: Seb3thehacker Date: Thu, 5 Nov 2026 18:06:58 -0800 Subject: [PATCH] Faded map buttons press on the first tap instead of only waking up --- .../seb3thehacker/gearslip/car/TemplateParts.kt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/car/TemplateParts.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/car/TemplateParts.kt index c583221..1ba37ad 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/car/TemplateParts.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/car/TemplateParts.kt @@ -248,8 +248,8 @@ internal fun RightEdgeControls( val hasPan = (actions + mapActions).any { it.type == Action.TYPE_PAN } androidx.compose.runtime.LaunchedEffect(hasPan) { if (!hasPan) connection.setPanMode(false) } - // Faded out when the screen has been left alone; then they are only a memory of buttons, so - // the first touch on one wakes them rather than pressing it. + // Faded out when the screen has been left alone, to leave the map clear, but still buttons: + // a tap on a faded one presses it straight away (and wakes the rest), as Android Auto's do. val awake = LocalMapControlsWake.current.awake val pan by connection.panMode.collectAsState() // Kept up while the knob is on one of them, or the ring would fade out along with the button. @@ -280,16 +280,7 @@ internal fun RightEdgeControls( .alpha(alpha) .focusRequester(knobFocus) .focusGroup() - .onFocusChanged { holdsFocus = it.hasFocus } - .let { base -> - if (visible) base else base.pointerInput(Unit) { - awaitPointerEventScope { - while (true) { - awaitPointerEvent(PointerEventPass.Initial).changes.forEach { it.consume() } - } - } - } - }, + .onFocusChanged { holdsFocus = it.hasFocus }, horizontalAlignment = alignment, verticalArrangement = Arrangement.spacedBy(8.dp), ) {