Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover2007-08-27 22:00:50 +0000
committerSteve Northover2007-08-27 22:00:50 +0000
commita3b0979fabcd78b8d5f896dda401ebe780fe2171 (patch)
treeed7ff2e8cd8ea03b7532b4d39b94af97348d5903
parentbb3acb6a7f8689f7c815f88c972ddb82333b7d6a (diff)
downloadeclipse.platform.swt-a3b0979fabcd78b8d5f896dda401ebe780fe2171.tar.gz
eclipse.platform.swt-a3b0979fabcd78b8d5f896dda401ebe780fe2171.tar.xz
eclipse.platform.swt-a3b0979fabcd78b8d5f896dda401ebe780fe2171.zip
work around Windows bug in WS_EX_COMPOSITED for tables with headers
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index b1ea89db80..0a78bb1cb1 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -259,7 +259,41 @@ int /*long*/ callWindowProc (int /*long*/ hwnd, int msg, int /*long*/ wParam, in
boolean oldSelected = wasSelected;
if (checkSelection) wasSelected = false;
if (checkActivate) ignoreActivate = true;
- int /*long*/ code = OS.CallWindowProc (TableProc, hwnd, msg, wParam, lParam);
+
+ /*
+ * Bug in Windows. For some reason, when the WS_EX_COMPOSITED
+ * style is set in a parent of a table and the header is visible,
+ * Windows issues an endless stream of WM_PAINT messages. The
+ * fix is to call BeginPaint() and EndPaint() outside of WM_PAINT
+ * and pass the paint HDC in to the window proc.
+ */
+ boolean fixPaint = false;
+ if (msg == OS.WM_PAINT) {
+ int bits0 = OS.GetWindowLong (handle, OS.GWL_STYLE);
+ if ((bits0 & OS.LVS_NOCOLUMNHEADER) == 0) {
+ int /*long*/ hwndParent = OS.GetParent (handle), hwndOwner = 0;
+ while (hwndParent != 0) {
+ int bits1 = OS.GetWindowLong (hwndParent, OS.GWL_EXSTYLE);
+ if ((bits1 & OS.WS_EX_COMPOSITED) != 0) {
+ fixPaint = true;
+ break;
+ }
+ hwndOwner = OS.GetWindow (hwndParent, OS.GW_OWNER);
+ if (hwndOwner != 0) break;
+ hwndParent = OS.GetParent (hwndParent);
+ }
+ }
+ }
+ int /*long*/ code = 0;
+ if (fixPaint) {
+ PAINTSTRUCT ps = new PAINTSTRUCT ();
+ int /*long*/ hDC = OS.BeginPaint (hwnd, ps);
+ code = OS.CallWindowProc (TableProc, hwnd, OS.WM_PAINT, hDC, lParam);
+ OS.EndPaint (hwnd, ps);
+ } else {
+ code = OS.CallWindowProc (TableProc, hwnd, msg, wParam, lParam);
+ }
+
if (checkActivate) ignoreActivate = false;
if (checkSelection) {
if (wasSelected || forceSelect) {

Back to the top