@@ -1618,14 +1618,14 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethodBase_setCompositionEnabled
1618
1618
if (NULL != pX11IMData -> statusWindow ) {
1619
1619
Window focus = 0 ;
1620
1620
int revert_to ;
1621
- #if defined(_LP64 ) && !defined(_LITTLE_ENDIAN )
1622
- // The Window value which is used for XGetICValues must be 32bit on BigEndian XOrg's xlib
1623
- unsigned int w = 0 ;
1624
- #else
1625
1621
Window w = 0 ;
1626
- #endif
1627
1622
XGetInputFocus (awt_display , & focus , & revert_to );
1628
1623
XGetICValues (pX11IMData -> current_ic , XNFocusWindow , & w , NULL );
1624
+ #if defined(_LP64 ) && !defined(_LITTLE_ENDIAN )
1625
+ // On 64bit BigEndian,
1626
+ // Window value may be stored on high 32bit by XGetICValues via XIM
1627
+ if (w > 0xffffffffUL ) w = w >> 32 ;
1628
+ #endif
1629
1629
if (RevertToPointerRoot == revert_to
1630
1630
&& pX11IMData -> ic_active != pX11IMData -> ic_passive ) {
1631
1631
if (pX11IMData -> current_ic == pX11IMData -> ic_active ) {
@@ -1674,12 +1674,7 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethodBase_isCompositionEnabledN
1674
1674
{
1675
1675
X11InputMethodData * pX11IMData = NULL ;
1676
1676
char * ret = NULL ;
1677
- #if defined(__linux__ ) && defined(_LP64 ) && !defined(_LITTLE_ENDIAN )
1678
- // XIMPreeditState value which is used for XGetICValues must be 32bit on BigEndian XOrg's xlib
1679
- unsigned int state = XIMPreeditUnKnown ;
1680
- #else
1681
1677
XIMPreeditState state = XIMPreeditUnKnown ;
1682
- #endif
1683
1678
1684
1679
XVaNestedList pr_atrb ;
1685
1680
@@ -1695,6 +1690,11 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11InputMethodBase_isCompositionEnabledN
1695
1690
ret = XGetICValues (pX11IMData -> current_ic , XNPreeditAttributes , pr_atrb , NULL );
1696
1691
XFree ((void * )pr_atrb );
1697
1692
AWT_UNLOCK ();
1693
+ #if defined(__linux__ ) && defined(_LP64 ) && !defined(_LITTLE_ENDIAN )
1694
+ // On 64bit BigEndian,
1695
+ // XIMPreeditState value may be stored on high 32bit by XGetICValues via XIM
1696
+ if (state > 0xffffffffUL ) state = state >> 32 ;
1697
+ #endif
1698
1698
1699
1699
if ((ret != 0 )
1700
1700
&& ((strcmp (ret , XNPreeditAttributes ) == 0 )
0 commit comments