diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioComponents.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioComponents.kt index 365b1a84..347fdedf 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioComponents.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/core/ui/NuvioComponents.kt @@ -58,6 +58,8 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.input.pointer.PointerEventPass +import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow @@ -98,6 +100,17 @@ fun NuvioScreen( ) } +internal fun Modifier.nuvioBlockPointerPassthrough(): Modifier = + pointerInput(Unit) { + awaitPointerEventScope { + while (true) { + awaitPointerEvent(PointerEventPass.Final).changes.forEach { change -> + change.consume() + } + } + } + } + @Composable fun NuvioSurfaceCard( modifier: Modifier = Modifier, @@ -132,6 +145,7 @@ fun NuvioScreenHeader( Row( modifier = modifier .fillMaxWidth() + .nuvioBlockPointerPassthrough() .background(MaterialTheme.colorScheme.background) .padding(top = resolvedTopPadding, bottom = 4.dp), horizontalArrangement = Arrangement.SpaceBetween, diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/library/LibraryScreen.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/library/LibraryScreen.kt index abc078a9..7febd8ea 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/library/LibraryScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/library/LibraryScreen.kt @@ -29,6 +29,7 @@ import com.nuvio.app.core.ui.NuvioStatusModal import com.nuvio.app.core.ui.NuvioToastController import com.nuvio.app.core.ui.NuvioViewAllPillSize import com.nuvio.app.core.ui.NuvioShelfSection +import com.nuvio.app.core.ui.nuvioBlockPointerPassthrough import com.nuvio.app.features.home.components.HomeEmptyStateCard import com.nuvio.app.features.home.components.HomePosterCard import com.nuvio.app.features.home.components.HomeSkeletonRow @@ -109,6 +110,7 @@ fun LibraryScreen( androidx.compose.foundation.layout.Column( modifier = Modifier .fillMaxWidth() + .nuvioBlockPointerPassthrough() .background(MaterialTheme.colorScheme.background), ) { NuvioScreenHeader( diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/search/SearchScreen.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/search/SearchScreen.kt index 3720ce52..adcaa7e6 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/search/SearchScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/search/SearchScreen.kt @@ -35,7 +35,6 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.Alignment import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester -import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.unit.Dp import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow @@ -47,6 +46,7 @@ import com.nuvio.app.core.ui.NuvioInputField import com.nuvio.app.core.ui.NuvioScreen import com.nuvio.app.core.ui.NuvioNetworkOfflineCard import com.nuvio.app.core.ui.NuvioScreenHeader +import com.nuvio.app.core.ui.nuvioBlockPointerPassthrough import com.nuvio.app.core.ui.withDuplicateSafeLazyKeys import com.nuvio.app.features.addons.AddonRepository import com.nuvio.app.features.home.HomeCatalogSettingsRepository @@ -241,14 +241,8 @@ fun SearchScreen( androidx.compose.foundation.layout.Column( modifier = Modifier .fillMaxWidth() - .background(MaterialTheme.colorScheme.background) - .pointerInput(Unit) { - awaitPointerEventScope { - while (true) { - awaitPointerEvent() - } - } - }, + .nuvioBlockPointerPassthrough() + .background(MaterialTheme.colorScheme.background), ) { NuvioScreenHeader( title = headerTitle, diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/SettingsComponents.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/SettingsComponents.kt index c8e2e418..b526a058 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/SettingsComponents.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/settings/SettingsComponents.kt @@ -48,6 +48,7 @@ import androidx.compose.ui.unit.dp import com.nuvio.app.core.ui.NuvioActionLabel import com.nuvio.app.core.ui.NuvioBackButton import com.nuvio.app.core.ui.NuvioSectionLabel +import com.nuvio.app.core.ui.nuvioBlockPointerPassthrough import com.nuvio.app.features.home.HomeCatalogSettingsItem import nuvio.composeapp.generated.resources.Res import nuvio.composeapp.generated.resources.settings_homescreen_collection_with_addon @@ -113,7 +114,9 @@ internal fun TabletPageHeader( onBack: () -> Unit, ) { Row( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier + .fillMaxWidth() + .nuvioBlockPointerPassthrough(), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp), ) {