File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
java/org/fcitx/fcitx5/android/core Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -316,8 +316,8 @@ void AndroidKeyboardEngine::commitBuffer(InputContext *inputContext) {
316
316
if (preedit.empty ()) {
317
317
return ;
318
318
}
319
- if (auto icv2 = dynamic_cast <InputContextV2 *>(inputContext )) {
320
- icv2 ->commitStringWithCursor (preedit, cursor);
319
+ if (inputContext-> capabilityFlags (). test (CapabilityFlag::CommitStringWithCursor )) {
320
+ inputContext ->commitStringWithCursor (preedit, cursor);
321
321
} else {
322
322
inputContext->commitString (preedit);
323
323
}
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import splitties.bitflags.hasFlag
6
6
7
7
/* *
8
8
* translated from
9
- * [fcitx-utils/capabilityflags.h](https://github.com/fcitx/fcitx5/blob/5.0.13 /src/lib/fcitx-utils/capabilityflags.h)
9
+ * [fcitx-utils/capabilityflags.h](https://github.com/fcitx/fcitx5/blob/5.1.1 /src/lib/fcitx-utils/capabilityflags.h)
10
10
*/
11
11
@Suppress(" unused" )
12
12
enum class CapabilityFlag (val flag : ULong ) {
@@ -60,6 +60,17 @@ enum class CapabilityFlag(val flag: ULong) {
60
60
*/
61
61
ClientSideInputPanel (1UL shl 39 ),
62
62
63
+ /* *
64
+ * Whether client request input method to be disabled.
65
+ * Usually this means only allow to type with raw keyboard.
66
+ */
67
+ Disable (1UL shl 40 ),
68
+
69
+ /* *
70
+ * Whether client support commit string with cursor location.
71
+ */
72
+ CommitStringWithCursor (1UL shl 41 ),
73
+
63
74
PasswordOrSensitive (Password .flag or Sensitive .flag);
64
75
65
76
}
@@ -75,7 +86,8 @@ value class CapabilityFlags constructor(val flags: ULong) {
75
86
76
87
val DefaultFlags = CapabilityFlags (
77
88
CapabilityFlag .Preedit ,
78
- CapabilityFlag .ClientUnfocusCommit
89
+ CapabilityFlag .ClientUnfocusCommit ,
90
+ CapabilityFlag .CommitStringWithCursor
79
91
)
80
92
81
93
fun fromEditorInfo (info : EditorInfo ): CapabilityFlags {
You can’t perform that action at this time.
0 commit comments