diff options
author | Silenio Quarti <silenio> | 2009-03-20 20:51:13 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2009-03-20 20:51:13 +0000 |
commit | c25065768a620986e779f5bcf9bb953d36bdd77b (patch) | |
tree | 12df9b1ccbfda798edc4f2ba98f25c8f092267b9 | |
parent | 7fccff985de1680cda4442339540104bad5d36a7 (diff) | |
download | eclipse.platform.swt-c25065768a620986e779f5bcf9bb953d36bdd77b.tar.gz eclipse.platform.swt-c25065768a620986e779f5bcf9bb953d36bdd77b.tar.xz eclipse.platform.swt-c25065768a620986e779f5bcf9bb953d36bdd77b.zip |
267468 - [SWT_AWT] Browser.print(GC) flickers
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 26 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java | 15 |
2 files changed, 25 insertions, 16 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); } } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java index fb016e99d5..acd1c8c3d6 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Group.java @@ -299,7 +299,14 @@ void printWidget (int /*long*/ hwnd, int /*long*/ hdc, GC gc) { */ boolean success = false; if (!(OS.GetDeviceCaps(gc.handle, OS.TECHNOLOGY) == OS.DT_RASPRINTER)) { + int bits = OS.GetWindowLong (hwnd, OS.GWL_STYLE); + 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); + } } /* @@ -334,12 +341,8 @@ void printWidget (int /*long*/ hwnd, int /*long*/ hdc, GC gc) { } int /*long*/ topHandle = children [i].topHandle(); int bits = OS.GetWindowLong (topHandle, OS.GWL_STYLE); - if ((bits & OS.WS_VISIBLE) == 0) { - OS.DefWindowProc (topHandle, OS.WM_SETREDRAW, 1, 0); - } - children [i].printWidget (topHandle, hdc, gc); - if ((bits & OS.WS_VISIBLE) == 0) { - OS.DefWindowProc (topHandle, OS.WM_SETREDRAW, 0, 0); + if ((bits & OS.WS_VISIBLE) != 0) { + children [i].printWidget (topHandle, hdc, gc); } if (graphicsMode == OS.GM_ADVANCED) { float [] lpXform = {1, 0, 0, 1, -location.x, -location.y}; |