File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
androidMain/kotlin/androidx/compose/ui/platform
commonMain/kotlin/androidx/compose/ui/platform
skikoMain/kotlin/androidx/compose/ui/platform Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import androidx.compose.ui.input.pointer.PointerKeyboardModifiers
2828 * Provides information about the Window that is hosting this compose hierarchy.
2929 */
3030@Stable
31+ @JvmDefaultWithCompatibility
3132actual interface WindowInfo {
3233 /* *
3334 * Indicates whether the window hosting this compose hierarchy is in focus.
@@ -41,8 +42,10 @@ actual interface WindowInfo {
4142 /* *
4243 * Indicates the state of keyboard modifiers (pressed or not).
4344 */
44- @ExperimentalComposeUiApi
45+ @Suppress(" OPT_IN_MARKER_ON_WRONG_TARGET" )
46+ @get:ExperimentalComposeUiApi
4547 actual val keyboardModifiers: PointerKeyboardModifiers
48+ get() = WindowInfoImpl .GlobalKeyboardModifiers .value
4649}
4750
4851internal class WindowInfoImpl : WindowInfo {
Original file line number Diff line number Diff line change @@ -23,11 +23,13 @@ import androidx.compose.runtime.rememberUpdatedState
2323import androidx.compose.runtime.snapshotFlow
2424import androidx.compose.ui.ExperimentalComposeUiApi
2525import androidx.compose.ui.input.pointer.PointerKeyboardModifiers
26+ import androidx.compose.ui.internal.JvmDefaultWithCompatibility
2627
2728/* *
2829 * Provides information about the Window that is hosting this compose hierarchy.
2930 */
3031@Stable
32+ @JvmDefaultWithCompatibility
3133expect interface WindowInfo {
3234 /* *
3335 * Indicates whether the window hosting this compose hierarchy is in focus.
@@ -41,8 +43,11 @@ expect interface WindowInfo {
4143 /* *
4244 * Indicates the state of keyboard modifiers (pressed or not).
4345 */
44- @ExperimentalComposeUiApi
45- val keyboardModifiers: PointerKeyboardModifiers
46+ // TODO(https://youtrack.jetbrains.com/issue/COMPOSE-412/Remove-getExperimentalComposeUiApi-from-val-keyboardModifiers)
47+ // remove get:ExperimentalComposeUiApi, as it actually isn't experimental
48+ @Suppress(" OPT_IN_MARKER_ON_WRONG_TARGET" )
49+ @get:ExperimentalComposeUiApi
50+ open val keyboardModifiers: PointerKeyboardModifiers
4651}
4752
4853@Composable
Original file line number Diff line number Diff line change @@ -23,12 +23,14 @@ import androidx.compose.runtime.setValue
2323import androidx.compose.ui.ExperimentalComposeUiApi
2424import androidx.compose.ui.input.pointer.EmptyPointerKeyboardModifiers
2525import androidx.compose.ui.input.pointer.PointerKeyboardModifiers
26+ import androidx.compose.ui.internal.JvmDefaultWithCompatibility
2627import androidx.compose.ui.unit.IntSize
2728
2829/* *
2930 * Provides information about the Window that is hosting this compose hierarchy.
3031 */
3132@Stable
33+ @JvmDefaultWithCompatibility
3234actual interface WindowInfo {
3335 /* *
3436 * Indicates whether the window hosting this compose hierarchy is in focus.
@@ -42,14 +44,16 @@ actual interface WindowInfo {
4244 /* *
4345 * Indicates the state of keyboard modifiers (pressed or not).
4446 */
45- @ExperimentalComposeUiApi
47+ @Suppress(" OPT_IN_MARKER_ON_WRONG_TARGET" )
48+ @get:ExperimentalComposeUiApi
4649 actual val keyboardModifiers: PointerKeyboardModifiers
50+ get() = WindowInfoImpl .GlobalKeyboardModifiers .value
4751
4852 /* *
4953 * Size of the window's content container in pixels.
5054 */
5155 @ExperimentalComposeUiApi
52- val containerSize: IntSize
56+ val containerSize: IntSize get() = IntSize . Zero
5357}
5458
5559internal class WindowInfoImpl : WindowInfo {
You can’t perform that action at this time.
0 commit comments