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-24 13:53:41 +0000
committerSilenio Quarti <silenio>2009-03-24 13:53:41 +0000
commit486b4ea7d81301a5e42feb98f944e7969e16da53 (patch)
tree0a1339084bc5f28167e180d95dd57ef1f973979d /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
parent00a56e584ec03947766dfaebe31a45b7ff97efda (diff)
downloadeclipse.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-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java18
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);