summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
diff options
context:
space:
mode:
authorSilenio Quarti <silenio>2009-03-20 20:51:13 +0000
committerSilenio Quarti <silenio>2009-03-20 20:51:13 +0000
commitc25065768a620986e779f5bcf9bb953d36bdd77b (patch)
tree12df9b1ccbfda798edc4f2ba98f25c8f092267b9 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
parent7fccff985de1680cda4442339540104bad5d36a7 (diff)
downloadeclipse.platform.swt-c25065768a620986e779f5bcf9bb953d36bdd77b.tar.gz
eclipse.platform.swt-c25065768a620986e779f5bcf9bb953d36bdd77b.tar.xz
eclipse.platform.swt-c25065768a620986e779f5bcf9bb953d36bdd77b.zip
267468 - [SWT_AWT] Browser.print(GC) flickers
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index b172428d22..c33cb3a566 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -1992,14 +1992,7 @@ public boolean print (GC gc) {
int flags = OS.RDW_UPDATENOW | OS.RDW_ALLCHILDREN;
OS.RedrawWindow (topHandle, null, 0, flags);
}
- int bits = OS.GetWindowLong (topHandle, OS.GWL_STYLE);
- if ((bits & OS.WS_VISIBLE) == 0) {
- OS.DefWindowProc (topHandle, OS.WM_SETREDRAW, 1, 0);
- }
printWidget (topHandle, hdc, gc);
- if ((bits & OS.WS_VISIBLE) == 0) {
- OS.DefWindowProc (topHandle, OS.WM_SETREDRAW, 0, 0);
- }
if (gdipGraphics != 0) {
OS.RestoreDC(hdc, state);
Gdip.Graphics_ReleaseHDC(gdipGraphics, hdc);
@@ -2065,19 +2058,32 @@ void printWidget (int /*long*/ hwnd, int /*long*/ hdc, GC gc) {
int width = OS.GetSystemMetrics (OS.SM_CXVIRTUALSCREEN);
int height = OS.GetSystemMetrics (OS.SM_CYVIRTUALSCREEN);
int flags = OS.SWP_NOSIZE | OS.SWP_NOZORDER | OS.SWP_NOACTIVATE | OS.SWP_DRAWFRAME;
- OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0);
+ if ((bits & OS.WS_VISIBLE) != 0) {
+ OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0);
+ }
SetWindowPos (hwnd, 0, x + width, y + height, 0, 0, flags);
OS.SetParent (hwnd, 0);
+ if ((bits & OS.WS_VISIBLE) != 0) {
+ OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0);
+ }
+ }
+ if ((bits & OS.WS_VISIBLE) == 0) {
OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0);
}
success = OS.PrintWindow (hwnd, hdc, 0);
+ if ((bits & OS.WS_VISIBLE) == 0) {
+ OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0);
+ }
if (fixPrintWindow) {
+ if ((bits & OS.WS_VISIBLE) != 0) {
+ OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0);
+ }
OS.SetParent (hwnd, hwndParent);
OS.MapWindowPoints (0, hwndParent, rect1, 2);
int flags = OS.SWP_NOSIZE | OS.SWP_NOACTIVATE | OS.SWP_DRAWFRAME;
SetWindowPos (hwnd, hwndInsertAfter, rect1.left, rect1.top, rect1.right - rect1.left, rect1.bottom - rect1.top, flags);
- if ((bits & OS.WS_VISIBLE) == 0) {
- OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0);
+ if ((bits & OS.WS_VISIBLE) != 0) {
+ OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0);
}
}
}