@@ -66,7 +66,6 @@ import kotlinx.coroutines.Job
66
66
import kotlinx.coroutines.channels.Channel
67
67
import kotlinx.coroutines.channels.consumeEach
68
68
import kotlinx.coroutines.launch
69
- import kotlinx.coroutines.withContext
70
69
import splitties.bitflags.hasFlag
71
70
import splitties.systemservices.inputMethodManager
72
71
import splitties.views.gravityBottom
@@ -85,7 +84,6 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
85
84
var inputView: InputView ? = null
86
85
private var initializationUi: InitializationUi ? = null
87
86
private var mIntentReceiver: IntentReceiver ? = null
88
- private var isWindowShown = false // 键盘窗口是否已显示
89
87
private var isComposable: Boolean = false
90
88
private val locales = Array (2 ) { Locale .getDefault() }
91
89
@@ -124,35 +122,6 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
124
122
*/
125
123
fun postRimeJob (block : suspend RimeApi .() -> Unit ) = postJob(rime.lifecycleScope) { rime.runOnReady(block) }
126
124
127
- override fun onWindowShown () {
128
- super .onWindowShown()
129
- if (isWindowShown) {
130
- Timber .i(" Ignoring (is already shown)" )
131
- return
132
- } else {
133
- Timber .i(" onWindowShown..." )
134
- }
135
- postRimeJob {
136
- if (currentInputEditorInfo != null ) {
137
- isWindowShown = true
138
- withContext(Dispatchers .Main ) {
139
- updateComposing()
140
- }
141
- }
142
- }
143
- }
144
-
145
- override fun onWindowHidden () {
146
- super .onWindowHidden()
147
- if (! isWindowShown) {
148
- Timber .d(" Ignoring (window is already hidden)" )
149
- return
150
- } else {
151
- Timber .d(" onWindowHidden" )
152
- }
153
- isWindowShown = false
154
- }
155
-
156
125
private suspend fun updateRimeOption (api : RimeApi ) {
157
126
try {
158
127
api.setRuntimeOption(" soft_cursor" , prefs.keyboard.softCursorEnabled) // 軟光標
0 commit comments