diff options
author | Felipe Heidrich <fheidric> | 2010-01-20 21:52:16 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2010-01-20 21:52:16 +0000 |
commit | f109ee6a8829d09be16619e7bb1f4c3554d04344 (patch) | |
tree | 9dd2965795eac1c1533cb63eb1c84a6955dac2a8 /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java | |
parent | b77986de05bab33a2fe06d4668b09aa4be644a68 (diff) | |
download | eclipse.platform.swt-f109ee6a8829d09be16619e7bb1f4c3554d04344.tar.gz eclipse.platform.swt-f109ee6a8829d09be16619e7bb1f4c3554d04344.tar.xz eclipse.platform.swt-f109ee6a8829d09be16619e7bb1f4c3554d04344.zip |
Bug 299714 - Control.print(GC) renders control state unusable (win 7)
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 | 33 |
1 files changed, 20 insertions, 13 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 c9d40265bc..9e34758ba5 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 @@ -2061,7 +2061,8 @@ void printWidget (int /*long*/ hwnd, int /*long*/ hdc, GC gc) { } OS.DeleteObject(rgn); } - int bits = OS.GetWindowLong (hwnd, OS.GWL_STYLE); + int bits1 = OS.GetWindowLong (hwnd, OS.GWL_STYLE); + int bits2 = OS.GetWindowLong (hwnd, OS.GWL_EXSTYLE); int /*long*/ hwndInsertAfter = OS.GetWindow (hwnd, OS.GW_HWNDPREV); /* * Bug in Windows. For some reason, when GetWindow () @@ -2078,34 +2079,40 @@ 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); - if ((bits & OS.WS_VISIBLE) != 0) { + int flags = OS.SWP_NOSIZE | OS.SWP_NOZORDER | OS.SWP_NOACTIVATE | OS.SWP_DRAWFRAME; + if ((bits1 & OS.WS_VISIBLE) != 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0); } - 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) { + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { + OS.SetWindowLong (hwnd, OS.GWL_STYLE, (bits1 & ~OS.WS_CHILD) | OS.WS_POPUP); + OS.SetWindowLong (hwnd, OS.GWL_EXSTYLE, bits2 | OS.WS_EX_TOOLWINDOW); + } + OS.SetParent (hwnd, 0); + if ((bits1 & OS.WS_VISIBLE) != 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0); } } - if ((bits & OS.WS_VISIBLE) == 0) { + if ((bits1 & OS.WS_VISIBLE) == 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0); } success = OS.PrintWindow (hwnd, hdc, 0); - if ((bits & OS.WS_VISIBLE) == 0) { + if ((bits1 & OS.WS_VISIBLE) == 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0); } if (fixPrintWindow) { - if ((bits & OS.WS_VISIBLE) != 0) { + if ((bits1 & OS.WS_VISIBLE) != 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 0, 0); } - OS.SetWindowLong (hwnd, OS.GWL_STYLE, bits); + if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { + OS.SetWindowLong (hwnd, OS.GWL_STYLE, bits1); + OS.SetWindowLong (hwnd, OS.GWL_EXSTYLE, bits2); + } OS.SetParent (hwnd, hwndParent); OS.MapWindowPoints (0, hwndParent, rect1, 2); - int flags = OS.SWP_NOSIZE | OS.SWP_NOACTIVATE; - SetWindowPos (hwnd, hwndInsertAfter, rect1.left, rect1.top, 0, 0, flags); - if ((bits & OS.WS_VISIBLE) != 0) { + 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 ((bits1 & OS.WS_VISIBLE) != 0) { OS.DefWindowProc (hwnd, OS.WM_SETREDRAW, 1, 0); } } |