diff options
author | Felipe Heidrich <fheidric> | 2003-05-05 20:11:55 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2003-05-05 20:11:55 +0000 |
commit | c36b29867250cba7303051a4b2fe5242a18b46b8 (patch) | |
tree | 04e3f8e803759c63de66c7ed261f949a10c4902c | |
parent | ef0845c1d792b16e1556389ac82336b6c364154b (diff) | |
download | eclipse.platform.swt-c36b29867250cba7303051a4b2fe5242a18b46b8.tar.gz eclipse.platform.swt-c36b29867250cba7303051a4b2fe5242a18b46b8.tar.xz eclipse.platform.swt-c36b29867250cba7303051a4b2fe5242a18b46b8.zip |
35319
4 files changed, 26 insertions, 12 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java index 13593ec531..070aa6abd4 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Canvas.java @@ -232,7 +232,8 @@ void updateCaret () { int ptr = OS.XtMalloc (4); OS.memmove (ptr, point, 4); int[] argList = {OS.XmNspotLocation, ptr}; - OS.XmImSetValues (handle, argList, argList.length / 2); + int focusHandle = focusHandle (); + OS.XmImSetValues (focusHandle, argList, argList.length / 2); if (ptr != 0) OS.XtFree (ptr); } int XExposure (int w, int client_data, int call_data, int continue_to_dispatch) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Caret.java index b6aaa170e8..9ba355d43c 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Caret.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Caret.java @@ -354,9 +354,9 @@ public void setFont (Font font) { } this.font = font; if (isVisible && parent.hasFocus()) { - int handle = parent.handle; + int focusHandle = parent.focusHandle (); int [] argList = {OS.XmNfontList, font.handle}; - OS.XmImSetValues (handle, argList, argList.length / 2); + OS.XmImSetValues (focusHandle, argList, argList.length / 2); } } /** diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java index e48b446c81..eb2b05187b 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Composite.java @@ -536,7 +536,14 @@ void setBackgroundPixel (int pixel) { } boolean setBounds (int x, int y, int width, int height, boolean move, boolean resize) { boolean changed = super.setBounds (x, y, width, height, move, resize); - if (changed && resize && layout != null) layout.layout (this, false); + if (changed && resize) { + if (focusHandle != 0) { + int [] argList = {OS.XmNwidth, 0, OS.XmNheight, 0}; + OS.XtGetValues (handle, argList, argList.length / 2); + OS.XtConfigureWidget (focusHandle, 0, 0, argList [1], argList [3], 0); + } + if (layout != null) layout.layout (this, false); + } return changed; } public boolean setFocus () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java index 58a39f571d..4ee02be8e7 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java @@ -432,7 +432,8 @@ void createWidget (int index) { * on a German locale. */ if (!hasIMSupport()) { - OS.XmImRegister (handle, 0); + int focusHandle = focusHandle (); + OS.XmImRegister (focusHandle, 0); } /* @@ -1375,7 +1376,8 @@ void releaseWidget () { } menu = null; if (!hasIMSupport()) { - OS.XmImUnregister (handle); + int focusHandle = focusHandle (); + OS.XmImUnregister (focusHandle); } parent = null; layoutData = null; @@ -1611,10 +1613,11 @@ byte [] sendIMKeyEvent (int type, XKeyEvent xEvent) { */ byte [] buffer = new byte [512]; int [] status = new int [1], unused = new int [1]; - int length = OS.XmImMbLookupString (handle, xEvent, buffer, buffer.length, unused, status); + int focusHandle = focusHandle (); + int length = OS.XmImMbLookupString (focusHandle, xEvent, buffer, buffer.length, unused, status); if (status [0] == OS.XBufferOverflow) { buffer = new byte [length]; - length = OS.XmImMbLookupString (handle, xEvent, buffer, length, unused, status); + length = OS.XmImMbLookupString (focusHandle, xEvent, buffer, length, unused, status); } if (length == 0) return null; @@ -1955,7 +1958,8 @@ public void setFont (Font font) { int [] argList2 = {OS.XmNfontList, font.handle}; OS.XtSetValues (fontHandle, argList2, argList2.length / 2); if (!hasIMSupport()) { - OS.XmImSetValues (handle, argList2, argList2.length / 2); + int focusHandle = focusHandle (); + OS.XmImSetValues (focusHandle, argList2, argList2.length / 2); } /* Restore the widget size */ @@ -2799,8 +2803,9 @@ int xFocusIn () { OS.XmNspotLocation, ptr, OS.XmNfontList, font.handle, }; - OS.XmImSetValues (handle, argList, argList.length / 2); - OS.XmImSetFocusValues (handle, null, 0); + int focusHandle = focusHandle (); + OS.XmImSetValues (focusHandle, argList, argList.length / 2); + OS.XmImSetFocusValues (focusHandle, null, 0); if (ptr != 0) OS.XtFree (ptr); } } @@ -2817,7 +2822,8 @@ int xFocusOut () { } if (!hasIMSupport()) { if (hooks (SWT.KeyDown) || hooks (SWT.KeyUp)) { - OS.XmImUnsetFocus (handle); + int focusHandle = focusHandle (); + OS.XmImUnsetFocus (focusHandle); } } return 0; |