diff options
author | Grant Gayed | 2004-02-23 21:55:00 +0000 |
---|---|---|
committer | Grant Gayed | 2004-02-23 21:55:00 +0000 |
commit | cad3066b557e8a1c1530551cce80b75994a5e3be (patch) | |
tree | f039d525719a3c603418533a7cfb03e902dc68e0 | |
parent | f7fd35ce796efd6deb0f128e0bfb6517562947ca (diff) | |
download | eclipse.platform.swt-cad3066b557e8a1c1530551cce80b75994a5e3be.tar.gz eclipse.platform.swt-cad3066b557e8a1c1530551cce80b75994a5e3be.tar.xz eclipse.platform.swt-cad3066b557e8a1c1530551cce80b75994a5e3be.zip |
45845
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java index 905126bf38..e638f812db 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Composite.java @@ -690,11 +690,11 @@ LRESULT WM_PAINT (int wParam, int lParam) { } /* Set the clipping bits */ - int oldBits = 0; + int oldBits = 0, newBits = 0; if (!OS.IsWinCE) { oldBits = OS.GetWindowLong (handle, OS.GWL_STYLE); - int newBits = oldBits | OS.WS_CLIPSIBLINGS | OS.WS_CLIPCHILDREN; - OS.SetWindowLong (handle, OS.GWL_STYLE, newBits); + newBits = oldBits | OS.WS_CLIPSIBLINGS | OS.WS_CLIPCHILDREN; + if (oldBits != newBits) OS.SetWindowLong (handle, OS.GWL_STYLE, newBits); } /* Create the paint GC */ @@ -752,15 +752,17 @@ LRESULT WM_PAINT (int wParam, int lParam) { event.gc = null; gc.dispose (); - if (!OS.IsWinCE) { - /* - * It is possible (but unlikely), that application - * code could have disposed the widget in the paint - * event. If this happens, don't attempt to restore - * the style. - */ - if (!isDisposed ()) { - OS.SetWindowLong (handle, OS.GWL_STYLE, oldBits); + if (!OS.IsWinCE) { + if (oldBits != newBits) { + /* + * It is possible (but unlikely), that application + * code could have disposed the widget in the paint + * event. If this happens, don't attempt to restore + * the style. + */ + if (!isDisposed ()) { + OS.SetWindowLong (handle, OS.GWL_STYLE, oldBits); + } } } return LRESULT.ZERO; |