diff options
author | Silenio Quarti <silenio> | 2009-03-24 13:53:41 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2009-03-24 13:53:41 +0000 |
commit | 486b4ea7d81301a5e42feb98f944e7969e16da53 (patch) | |
tree | 0a1339084bc5f28167e180d95dd57ef1f973979d /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | |
parent | 00a56e584ec03947766dfaebe31a45b7ff97efda (diff) | |
download | eclipse.platform.swt-486b4ea7d81301a5e42feb98f944e7969e16da53.tar.gz eclipse.platform.swt-486b4ea7d81301a5e42feb98f944e7969e16da53.tar.xz eclipse.platform.swt-486b4ea7d81301a5e42feb98f944e7969e16da53.zip |
223800 - Control.print(GC) does not work when an ancestor is not visible
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java')
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 18 |
1 files changed, 14 insertions, 4 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 c33cb3a566..b0976166cc 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 @@ -2025,10 +2025,20 @@ void printWidget (int /*long*/ hwnd, int /*long*/ hdc, GC gc) { } RECT rect1 = new RECT (); OS.GetWindowRect (hwnd, rect1); - RECT rect2 = new RECT (); - OS.GetWindowRect (hwndShell, rect2); - OS.IntersectRect (rect2, rect1, rect2); - boolean fixPrintWindow = !OS.EqualRect (rect2, rect1); + boolean fixPrintWindow = !OS.IsWindowVisible(hwnd); + if (!fixPrintWindow) { + RECT rect2 = new RECT (); + OS.GetWindowRect (hwndShell, rect2); + OS.IntersectRect (rect2, rect1, rect2); + fixPrintWindow = !OS.EqualRect (rect2, rect1); + } + /* + * Bug in Windows. PrintWindow does not print portions + * of the receiver that are removed by regions set int a + * parent. The fix is temporarily reparent the window to + * the desktop, call PrintWindow() then reparent the window + * back. + */ if (!fixPrintWindow) { int /*long*/ rgn = OS.CreateRectRgn(0, 0, 0, 0); int /*long*/ parent = OS.GetParent(hwnd); |