summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets
diff options
context:
space:
mode:
authorBogdan Gheorghe <gheorghe@ca.ibm.com>2013-01-22 14:27:07 -0500
committerBogdan Gheorghe <gheorghe@ca.ibm.com>2013-01-22 14:27:07 -0500
commitbe7b1104bd228e179987a0bab6a5b14be7d2cb61 (patch)
tree14ae6d5b301253503e572f00846786968339be6f /bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets
parentd3b70aad7149876ba42093794d2909bb52409b12 (diff)
downloadeclipse.platform.swt-be7b1104bd228e179987a0bab6a5b14be7d2cb61.tar.gz
eclipse.platform.swt-be7b1104bd228e179987a0bab6a5b14be7d2cb61.tar.xz
eclipse.platform.swt-be7b1104bd228e179987a0bab6a5b14be7d2cb61.zip
Bug 393833 - Vertical scroll bar still shows after calling setVisible(false) in Windows 7
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
index 60f692a04b..b35b3ea59f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/ScrollBar.java
@@ -992,6 +992,24 @@ public void setVisible (boolean visible) {
state = visible ? state & ~HIDDEN : state | HIDDEN;
long /*int*/ hwnd = hwndScrollBar ();
int type = scrollBarType ();
+ /*
+ * Bug in Windows 7. Windows will cause pixel corruption
+ * when there is only one scroll bar visible and it is
+ * hidden. The fix is to temporarily show the other scroll
+ * bar and hide both.
+ */
+ if (!visible) {
+ if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {
+ SCROLLBARINFO psbi = new SCROLLBARINFO ();
+ psbi.cbSize = SCROLLBARINFO.sizeof;
+ int idObject = (style & SWT.VERTICAL) != 0 ? OS.OBJID_HSCROLL : OS.OBJID_VSCROLL;
+ OS.GetScrollBarInfo (hwnd, idObject, psbi);
+ if ((psbi.rgstate [0] & OS.STATE_SYSTEM_INVISIBLE) != 0) {
+ OS.ShowScrollBar (hwnd, type == OS.SB_VERT ? OS.SB_HORZ : OS.SB_VERT, true);
+ type = OS.SB_BOTH;
+ }
+ }
+ }
if (OS.ShowScrollBar (hwnd, type, visible)) {
/*
* Bug in Windows. For some reason, when the widget