From eeddf1ccd6b462299e1cfc5a858465af29977bf7 Mon Sep 17 00:00:00 2001 From: Felipe Heidrich Date: Tue, 19 Jan 2010 20:54:02 +0000 Subject: Bug 299714 - Control.print(GC) renders control state unusable (win 7) --- .../Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java') 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 1e47ec752f..c9d40265bc 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 @@ -2078,12 +2078,13 @@ void printWidget (int /*long*/ hwnd, int /*long*/ hdc, GC gc) { int y = OS.GetSystemMetrics (OS.SM_YVIRTUALSCREEN); 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; 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.SetWindowLong (hwnd, OS.GWL_STYLE, (bits & ~OS.WS_CHILD) | OS.WS_POPUP); OS.SetParent (hwnd, 0); + int flags = OS.SWP_NOSIZE | OS.SWP_NOZORDER | OS.SWP_NOACTIVATE; + SetWindowPos (hwnd, 0, x + width, y + height, 0, 0, flags); if ((bits & OS.WS_VISIBLE) != 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0); } @@ -2099,10 +2100,11 @@ void printWidget (int /*long*/ hwnd, int /*long*/ hdc, GC gc) { if ((bits & OS.WS_VISIBLE) != 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0); } + OS.SetWindowLong (hwnd, OS.GWL_STYLE, bits); 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); + int flags = OS.SWP_NOSIZE | OS.SWP_NOACTIVATE; + SetWindowPos (hwnd, hwndInsertAfter, rect1.left, rect1.top, 0, 0, flags); if ((bits & OS.WS_VISIBLE) != 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0); } -- cgit