├── .github └── workflows │ └── jbr-linux-x64.yml ├── README.md └── idea.patch /.github/workflows/jbr-linux-x64.yml: -------------------------------------------------------------------------------- 1 | name: jbr-linux-x64 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | release_id: 7 | required: true 8 | default: 'latest' 9 | type: string 10 | description: "Release id or tag" 11 | jbr_branch: 12 | required: false 13 | type: string 14 | description: "JBR branch" 15 | 16 | jobs: 17 | build: 18 | runs-on: ubuntu-20.04 19 | steps: 20 | - name: Clone Repository 21 | uses: actions/checkout@v4 22 | 23 | - name: Generate Variables 24 | id: vars 25 | run: | 26 | release_id='${{ github.event.inputs.release_id }}' 27 | if [[ -z "$release_id" ]]; then 28 | release_id=latest 29 | elif [[ "$release_id" != latest && "$release_id" != tags/* ]]; then 30 | release_id="tags/$release_id" 31 | fi 32 | curl -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -sfL -m 60 -o /tmp/latest.json "${{ github.api_url }}/repos/JetBrains/JetBrainsRuntime/releases/${release_id}" 33 | 34 | release_name=$(jq -r .name /tmp/latest.json) 35 | echo "Release: $release_name" 36 | echo "release_name=$release_name" >> $GITHUB_OUTPUT 37 | 38 | html_url=$(jq -r .html_url /tmp/latest.json) 39 | echo "Release URL: $html_url" 40 | echo "release_body=$html_url" >> $GITHUB_OUTPUT 41 | 42 | tag_name=$(jq -r .tag_name /tmp/latest.json) 43 | echo "Tag: $tag_name" 44 | echo "tag_name=$tag_name" >> $GITHUB_OUTPUT 45 | 46 | if [[ "$tag_name" == jbr17* ]]; then 47 | JBSDK_VERSION=$(sed -E 's/^jbr([0-9_.]+)b.*$/\1/' <<< "$tag_name") 48 | build_number=$(sed -E 's/^jbr[0-9_.]+b([0-9.]+)$/\1/' <<< "$tag_name") 49 | elif [[ "$tag_name" == jbr-release-17.* ]]; then 50 | JBSDK_VERSION=$(sed -E 's/^jbr-release-([0-9_.]+)b.*$/\1/' <<< "$tag_name") 51 | build_number=$(sed -E 's/^jbr-release-[0-9_.]+b([0-9.]+)$/\1/' <<< "$tag_name") 52 | else 53 | echo unknown tag name: $tag_name 54 | exit 1 55 | fi 56 | 57 | echo "JBSDK Version: $JBSDK_VERSION" 58 | echo "JBSDK_VERSION=$JBSDK_VERSION" >> $GITHUB_OUTPUT 59 | echo "Build Number: $build_number" 60 | echo "build_number=$build_number" >> $GITHUB_OUTPUT 61 | 62 | ref='${{ github.event.inputs.jbr_branch }}' 63 | if [[ -z "$ref" ]]; then 64 | ref="jb${JBSDK_VERSION}-b${build_number}" 65 | fi 66 | echo "Ref: $ref" 67 | echo "ref=$ref" >> $GITHUB_OUTPUT 68 | 69 | - name: Init Build Dependencies 70 | env: 71 | DEBIAN_FRONTEND: noninteractive 72 | run: | 73 | sudo apt-get update -y 74 | sudo rm -f /var/lib/man-db/auto-update 75 | echo update_initramfs=no | sudo tee /etc/initramfs-tools/update-initramfs.conf 76 | sudo apt-get install -y libasound2-dev libavcodec-dev libavformat-dev libcups2-dev libgl1-mesa-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgtk2.0-dev libgtk-3-dev libudev-dev libxrandr-dev libxslt1-dev libxtst-dev libxxf86vm-dev x11proto-xf86vidmode-dev 77 | sudo apt-get clean -y 78 | 79 | - name: Prepare JCEF 80 | run: | 81 | aria2c -x 5 -o jbrsdk_jcef.tgz 'https://cache-redirector.jetbrains.com/intellij-jbr/jbrsdk_jcef-${{ steps.vars.outputs.JBSDK_VERSION }}-linux-x64-b${{ steps.vars.outputs.build_number }}.tar.gz' 82 | mkdir jcef_linux_x64 83 | cd jcef_linux_x64 84 | tar -zxvf ../jbrsdk_jcef.tgz --strip-components=1 && rm -f ../jbrsdk_jcef.tgz 85 | cat release 86 | grep '^JCEF_VERSION' release > jcef.version 87 | rm -f jmods/java.{base,desktop}.jmod 88 | 89 | - name: Clone JBR Repository 90 | uses: actions/checkout@v4 91 | with: 92 | repository: JetBrains/JetBrainsRuntime 93 | ref: ${{ steps.vars.outputs.ref }} 94 | fetch-depth: 0 # 这里必须拉取全部历史,下面的mkimages_x64.sh里面会通过git log找tag 95 | path: JetBrainsRuntime 96 | 97 | - name: Patch & Compile JetBrainsRuntime with JCEF 98 | id: compile 99 | run: | 100 | cd JetBrainsRuntime 101 | git log -1 102 | 103 | patch -p1 < ../idea.patch 104 | 105 | mv ../jcef_linux_x64 ./ 106 | 107 | export BOOT_JDK="$JAVA_HOME_17_X64" 108 | 109 | jb/project/tools/linux/scripts/mkimages_x64.sh '${{ steps.vars.outputs.build_number }}' jcef 110 | 111 | echo "jbr_image=$(ls -1 jbr_jcef-*-linux-x64-*.tar.gz)" >> $GITHUB_OUTPUT 112 | 113 | - name: Create Release 114 | id: create_release 115 | uses: softprops/action-gh-release@v2 116 | env: 117 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 118 | with: 119 | tag_name: ${{ steps.vars.outputs.tag_name }} 120 | name: ${{ steps.vars.outputs.release_name }} 121 | body: ${{ steps.vars.outputs.release_body }} 122 | draft: false 123 | prerelease: true 124 | files: JetBrainsRuntime/${{ steps.compile.outputs.jbr_image }} 125 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JetBrainsRuntime-for-Linux-x64 2 | 3 | 官方已经修复问题,不再维护 4 | 5 | 官方跟进issue链接: https://youtrack.jetbrains.com/issue/JBR-2460 6 | -------------------------------------------------------------------------------- /idea.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/java.desktop/share/classes/java/awt/Container.java b/src/java.desktop/share/classes/java/awt/Container.java 2 | index dc5bb4a408e..335de26ad98 100644 3 | --- a/src/java.desktop/share/classes/java/awt/Container.java 4 | +++ b/src/java.desktop/share/classes/java/awt/Container.java 5 | @@ -25,6 +25,7 @@ 6 | 7 | package java.awt; 8 | 9 | +import java.awt.Point; 10 | import java.awt.dnd.DropTarget; 11 | import java.awt.event.AWTEventListener; 12 | import java.awt.event.ComponentEvent; 13 | @@ -682,6 +683,14 @@ public class Container extends Component { 14 | } 15 | } 16 | 17 | + /** 18 | + * fix fcitx position 19 | + * @return Point 20 | + */ 21 | + public Point getPeerLocationOnScreen(){ 22 | + return peer.getLocationOnScreen(); 23 | + } 24 | + 25 | /** 26 | * Detects whether or not remove from current parent and adding to new parent requires call of 27 | * removeNotify on the component. Since removeNotify destroys native window this might (not) 28 | diff --git a/src/java.desktop/share/classes/javax/swing/JTextArea.java b/src/java.desktop/share/classes/javax/swing/JTextArea.java 29 | index ecc9342f05a..eea39c9e03a 100644 30 | --- a/src/java.desktop/share/classes/javax/swing/JTextArea.java 31 | +++ b/src/java.desktop/share/classes/javax/swing/JTextArea.java 32 | @@ -562,6 +562,14 @@ public class JTextArea extends JTextComponent { 33 | return rowHeight; 34 | } 35 | 36 | + /** 37 | + * fix fcitx position 38 | + * @return FontMetrics 39 | + */ 40 | + public FontMetrics getFontMetrics() { 41 | + return getFontMetrics(getFont()); 42 | + } 43 | + 44 | /** 45 | * Returns the number of columns in the TextArea. 46 | * 47 | diff --git a/src/java.desktop/share/classes/javax/swing/JTextField.java b/src/java.desktop/share/classes/javax/swing/JTextField.java 48 | index 3abe09d0565..50dc549bdba 100644 49 | --- a/src/java.desktop/share/classes/javax/swing/JTextField.java 50 | +++ b/src/java.desktop/share/classes/javax/swing/JTextField.java 51 | @@ -427,6 +427,14 @@ public class JTextField extends JTextComponent implements SwingConstants { 52 | return columnWidth; 53 | } 54 | 55 | + /** 56 | + * fix fcitx position 57 | + * @return FontMetrics 58 | + */ 59 | + public FontMetrics getFontMetrics() { 60 | + return getFontMetrics(getFont()); 61 | + } 62 | + 63 | /** 64 | * Returns the preferred size Dimensions needed for this 65 | * TextField. If a non-zero number of columns has been 66 | diff --git a/src/java.desktop/share/classes/sun/awt/im/InputContext.java b/src/java.desktop/share/classes/sun/awt/im/InputContext.java 67 | index bb955dc5089..7c42e2aa685 100644 68 | --- a/src/java.desktop/share/classes/sun/awt/im/InputContext.java 69 | +++ b/src/java.desktop/share/classes/sun/awt/im/InputContext.java 70 | @@ -28,6 +28,7 @@ package sun.awt.im; 71 | import java.awt.AWTEvent; 72 | import java.awt.AWTKeyStroke; 73 | import java.awt.Component; 74 | +import java.awt.Cursor; 75 | import java.awt.EventQueue; 76 | import java.awt.Frame; 77 | import java.awt.Rectangle; 78 | @@ -39,6 +40,7 @@ import java.awt.event.FocusEvent; 79 | import java.awt.event.InputEvent; 80 | import java.awt.event.InputMethodEvent; 81 | import java.awt.event.KeyEvent; 82 | +import java.awt.event.MouseEvent; 83 | import java.awt.event.WindowEvent; 84 | import java.awt.event.WindowListener; 85 | import java.awt.im.InputMethodRequests; 86 | @@ -54,6 +56,7 @@ import java.util.prefs.BackingStoreException; 87 | import java.util.prefs.Preferences; 88 | import sun.util.logging.PlatformLogger; 89 | import sun.awt.SunToolkit; 90 | +import sun.awt.X11InputMethod; 91 | 92 | /** 93 | * This InputContext class contains parts of the implementation of 94 | @@ -249,13 +252,23 @@ public class InputContext extends java.awt.im.InputContext 95 | focusLost((Component) event.getSource(), ((FocusEvent) event).isTemporary()); 96 | break; 97 | 98 | + case MouseEvent.MOUSE_RELEASED: 99 | + if (((Component) event.getSource()).getCursor().getType() == Cursor.TEXT_CURSOR) { 100 | + transCaretPositionToXIM((Component) event.getSource()); 101 | + break; 102 | + } 103 | + 104 | case KeyEvent.KEY_PRESSED: 105 | - if (checkInputMethodSelectionKey((KeyEvent)event)) { 106 | + if (event instanceof KeyEvent && checkInputMethodSelectionKey((KeyEvent)event)) { 107 | // pop up the input method selection menu 108 | InputMethodManager.getInstance().notifyChangeRequestByHotKey((Component)event.getSource()); 109 | break; 110 | } 111 | 112 | + case KeyEvent.KEY_RELEASED: 113 | + transCaretPositionToXIM((Component) event.getSource()); 114 | + break; 115 | + 116 | // fall through 117 | 118 | default: 119 | @@ -360,6 +373,46 @@ public class InputContext extends java.awt.im.InputContext 120 | } 121 | } 122 | 123 | + /** 124 | + * fix fcitx position 125 | + */ 126 | + private void transCaretPositionToXIM(Component source) { 127 | + synchronized (source.getTreeLock()) { 128 | + synchronized (this) { 129 | + if ("sun.awt.im.CompositionArea".equals(source.getClass().getName())) { 130 | + // no special handling for this one 131 | + } else if (getComponentWindow(source) instanceof InputMethodWindow) { 132 | + // no special handling for this one either 133 | + } else { 134 | + if (!source.isDisplayable()) { 135 | + // Component is being disposed 136 | + return; 137 | + } 138 | + currentClientComponent = source; 139 | + } 140 | + awtFocussedComponent = source; 141 | + if (inputMethod != null && inputMethod instanceof X11InputMethod) { 142 | + ((X11InputMethod)inputMethod).setXICTextCursorPosition(source); 143 | + } 144 | + InputMethodContext inputContext = ((InputMethodContext)this); 145 | + if (!inputContext.isCompositionAreaVisible()) { 146 | + InputMethodRequests req = source.getInputMethodRequests(); 147 | + if (req != null && inputContext.useBelowTheSpotInput()) { 148 | + inputContext.setCompositionAreaUndecorated(true); 149 | + } else { 150 | + inputContext.setCompositionAreaUndecorated(false); 151 | + } 152 | + } 153 | + // restores the composition area if it was set to invisible 154 | + // when focus got lost 155 | + if (compositionAreaHidden == true) { 156 | + ((InputMethodContext)this).setCompositionAreaVisible(true); 157 | + compositionAreaHidden = false; 158 | + } 159 | + } 160 | + } 161 | + } 162 | + 163 | /** 164 | * Activates the current input method of this input context, and grabs 165 | * the composition area for use by this input context. 166 | diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XInputMethod.java b/src/java.desktop/unix/classes/sun/awt/X11/XInputMethod.java 167 | index 26afc6e2de3..11ab161be59 100644 168 | --- a/src/java.desktop/unix/classes/sun/awt/X11/XInputMethod.java 169 | +++ b/src/java.desktop/unix/classes/sun/awt/X11/XInputMethod.java 170 | @@ -49,6 +49,15 @@ import javax.swing.event.CaretEvent; 171 | import javax.swing.event.CaretListener; 172 | import javax.swing.text.JTextComponent; 173 | 174 | +import java.awt.geom.Point2D; 175 | +import java.awt.FontMetrics; 176 | +import java.awt.Point; 177 | +import java.lang.reflect.Field; 178 | +import java.lang.reflect.InvocationTargetException; 179 | +import java.lang.reflect.Method; 180 | +import javax.swing.JTextArea; 181 | +import javax.swing.JTextField; 182 | + 183 | /** 184 | * Input Method Adapter for XIM (without Motif) 185 | * 186 | @@ -171,6 +180,81 @@ public class XInputMethod extends X11InputMethod { 187 | return releaseXICNative(pData); 188 | } 189 | 190 | + /** 191 | + * fix fcitx position 192 | + */ 193 | + public void setXICTextCursorOffXY(ComponentPeer peer) { 194 | + if (peer == null) { 195 | + return; 196 | + } 197 | + xicFocus = ((XComponentPeer)peer).getContentWindow(); 198 | + int[] result = getOffXYRelateToFrame(peer ,true); 199 | + setXICFocusNative(((XComponentPeer)peer).getContentWindow(),true,true,result); 200 | + } 201 | + 202 | + protected int[] getOffXYRelateToFrame(ComponentPeer peer, boolean value) { 203 | + int[] result = null; 204 | + if(value && this.awtFocussedComponent !=null && this.awtFocussedComponent instanceof JTextComponent){ 205 | + try { 206 | + Method method_getFontMetrics = null; 207 | + Method method_getEditor = null; 208 | + FontMetrics font_metrics = null; 209 | + Object editor = null; 210 | + int font_height = 0; 211 | + int caret_x = 0; 212 | + int caret_y = 0; 213 | + if(this.awtFocussedComponent instanceof JTextArea || this.awtFocussedComponent instanceof JTextField){ 214 | + method_getFontMetrics = this.awtFocussedComponent.getClass().getMethod("getFontMetrics"); 215 | + font_metrics = (FontMetrics)method_getFontMetrics.invoke(this.awtFocussedComponent); 216 | + font_height = font_metrics.getHeight(); 217 | + JTextComponent jc = (JTextComponent)this.awtFocussedComponent; 218 | + if(jc.getCaret().getMagicCaretPosition() != null) { 219 | + caret_x = jc.getCaret().getMagicCaretPosition().x; 220 | + caret_y = jc.getCaret().getMagicCaretPosition().y; 221 | + } 222 | + } else { 223 | + method_getEditor = this.awtFocussedComponent.getClass().getMethod("getEditor"); 224 | + 225 | + editor = method_getEditor.invoke(this.awtFocussedComponent); 226 | + 227 | + method_getFontMetrics = editor.getClass().getMethod("getFontMetrics",int.class); 228 | + font_metrics = (FontMetrics)method_getFontMetrics.invoke(editor, 0); 229 | + font_height = font_metrics.getHeight(); 230 | + Method getCaretLocations = editor.getClass().getMethod("getCaretLocations", boolean.class); 231 | + Object[] locations = (Object[])getCaretLocations.invoke(editor, false); 232 | + Field point = locations[0].getClass().getField("myPoint"); 233 | + Object myPoint = point.get(locations[0]); 234 | + if (myPoint instanceof Point) { 235 | + // convert to Point 236 | + Point p = (Point) myPoint; 237 | + caret_x = p.x; 238 | + caret_y = p.y; 239 | + } else if (myPoint instanceof Point2D) { 240 | + // convert to Point2D.Double 241 | + Point2D.Double pd = (Point2D.Double) myPoint; 242 | + caret_x = (int) pd.x; 243 | + caret_y = (int) pd.y; 244 | + } 245 | + } 246 | + 247 | + Method method_getLocationOnScreen = this.awtFocussedComponent.getClass().getMethod("getLocationOnScreen"); 248 | + 249 | + Point point = (Point)method_getLocationOnScreen.invoke(this.awtFocussedComponent); 250 | + 251 | + Method method_getNativeContainer = Component.class.getDeclaredMethod("getNativeContainer"); 252 | + method_getNativeContainer.setAccessible(true); 253 | + Container c = (Container)method_getNativeContainer.invoke(awtFocussedComponent); 254 | + if(c != null) 255 | + result = new int[]{point.x - c.getPeerLocationOnScreen().x + caret_x, point.y - c.getPeerLocationOnScreen().y + font_height + caret_y}; 256 | + 257 | + return result; 258 | + } catch (Exception e) { 259 | + e.printStackTrace(); 260 | + } 261 | + } 262 | + return result; 263 | + } 264 | + 265 | private static volatile long xicFocus = 0; 266 | 267 | protected void setXICFocus(ComponentPeer peer, boolean value, boolean active) { 268 | @@ -180,7 +264,7 @@ public class XInputMethod extends X11InputMethod { 269 | xicFocus = ((XComponentPeer)peer).getContentWindow(); 270 | setXICFocusNative(((XComponentPeer)peer).getContentWindow(), 271 | value, 272 | - active); 273 | + active, getOffXYRelateToFrame(peer ,value)); 274 | 275 | doesSupportMovingCandidatesNativeWindow = value && doesFocusedXICSupportMovingCandidatesNativeWindow(); 276 | } 277 | @@ -553,7 +637,7 @@ public class XInputMethod extends X11InputMethod { 278 | private native boolean createXICNative(long window, boolean preferBelowTheSpot); 279 | private native boolean recreateXICNative(long window, long px11data, int ctxid, boolean preferBelowTheSpot); 280 | private native int releaseXICNative(long px11data); 281 | - private native void setXICFocusNative(long window, boolean value, boolean active); 282 | + private native void setXICFocusNative(long window, boolean value, boolean active, int[] offxy); 283 | private native void adjustStatusWindow(long window); 284 | 285 | private native boolean doesFocusedXICSupportMovingCandidatesNativeWindow(); 286 | diff --git a/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java b/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java 287 | index d9bed439688..623af69478e 100644 288 | --- a/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java 289 | +++ b/src/java.desktop/unix/classes/sun/awt/X11InputMethod.java 290 | @@ -33,6 +33,7 @@ import java.awt.AWTException; 291 | import java.awt.event.InputMethodEvent; 292 | import java.awt.font.TextAttribute; 293 | import java.awt.font.TextHitInfo; 294 | +import java.awt.Component; 295 | import java.awt.peer.ComponentPeer; 296 | import java.text.AttributedString; 297 | import java.util.Map; 298 | @@ -57,6 +58,11 @@ public abstract class X11InputMethod extends X11InputMethodBase { 299 | super(); 300 | } 301 | 302 | + /** 303 | + * fix fcitx position 304 | + */ 305 | + public abstract void setXICTextCursorOffXY(ComponentPeer peer); 306 | + 307 | /** 308 | * Reset the composition state to the current composition state. 309 | */ 310 | @@ -380,6 +386,27 @@ public abstract class X11InputMethod extends X11InputMethodBase { 311 | } 312 | } 313 | 314 | + /** 315 | + * fix fcitx position 316 | + */ 317 | + public synchronized void setXICTextCursorPosition(Component component) { 318 | + if (component == null) { 319 | + return; 320 | + } 321 | + if (isActive) { 322 | + // deactivate/activate are being suppressed during a focus change - 323 | + // this may happen when an input method window is made visible 324 | + // boolean ac = haveActiveClient(); already set true in awt_InputMethod.c 325 | + setXICTextCursorOffXY(getPeer(awtFocussedComponent)); 326 | + 327 | + } 328 | + awtFocussedComponent = component; 329 | + ComponentPeer awtFocussedComponentPeer = getPeer(awtFocussedComponent); 330 | + if(awtFocussedComponent != null) { 331 | + setXICTextCursorOffXY(awtFocussedComponentPeer); 332 | + } 333 | + } 334 | + 335 | protected abstract boolean recreateXIC(int ctxid); 336 | protected abstract int releaseXIC(); 337 | private static native boolean recreateX11InputMethod(); 338 | diff --git a/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c b/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c 339 | index da112303668..e42fefd4e75 100644 340 | --- a/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c 341 | +++ b/src/java.desktop/unix/native/libawt_xawt/awt/awt_InputMethod.c 342 | @@ -514,13 +514,17 @@ setXICFocus(XIC ic, unsigned short req) 343 | * Sets the focus window to the given XIC. 344 | */ 345 | static void 346 | -setXICWindowFocus(XIC ic, Window w) 347 | +setXICWindowFocus(XIC ic, Window w, int arr[2]) 348 | { 349 | if (ic == NULL) { 350 | (void)fprintf(stderr, "Couldn't find X Input Context\n"); 351 | return; 352 | } 353 | - (void) XSetICValues(ic, XNFocusWindow, w, NULL); 354 | + XPoint spot; 355 | + spot.x = arr[0]; 356 | + spot.y = arr[1]; 357 | + XVaNestedList xy = (XVaNestedList)XVaCreateNestedList(0, XNSpotLocation, &spot, NULL); 358 | + (void) XSetICValues(ic, XNFocusWindow, w, XNPreeditAttributes, xy, NULL); 359 | } 360 | 361 | /* 362 | @@ -1637,7 +1641,8 @@ Java_sun_awt_X11_XInputMethod_setXICFocusNative(JNIEnv *env, 363 | jobject this, 364 | jlong w, 365 | jboolean req, 366 | - jboolean active) 367 | + jboolean active, 368 | + jintArray arr) 369 | { 370 | X11InputMethodData *pX11IMData; 371 | AWT_LOCK(); 372 | @@ -1658,7 +1663,17 @@ Java_sun_awt_X11_XInputMethod_setXICFocusNative(JNIEnv *env, 373 | * On Solaris2.6, setXICWindowFocus() has to be invoked 374 | * before setting focus. 375 | */ 376 | - setXICWindowFocus(pX11IMData->current_ic, w); 377 | + int positions[2] = {100,50}; 378 | + if (arr) 379 | + { 380 | + int length = (*env)->GetArrayLength(env,arr); 381 | + int *addArr = (*env)->GetIntArrayElements(env, arr, NULL); 382 | + for (int i= 0; i < length; ++i) { 383 | + positions[i] = *(addArr + i); 384 | + } 385 | + (*env)->ReleaseIntArrayElements(env, arr, addArr, 0); 386 | + } 387 | + setXICWindowFocus(pX11IMData->current_ic, w, positions); 388 | setXICFocus(pX11IMData->current_ic, req); 389 | currentX11InputMethodInstance = pX11IMData->x11inputmethod; 390 | currentFocusWindow = w; 391 | --------------------------------------------------------------------------------