diff options
author | Silenio Quarti | 2005-03-29 03:20:21 +0000 |
---|---|---|
committer | Silenio Quarti | 2005-03-29 03:20:21 +0000 |
commit | 203ddea40f3cc9c4394b9ba6e9ff55a009bc21f4 (patch) | |
tree | 8095adff2d1c758b290cd278bcc79f09de96fa8c | |
parent | dc3a3d47ce7d68140595e0e1ea1e11f6bd7078b4 (diff) | |
download | eclipse.platform.swt-203ddea40f3cc9c4394b9ba6e9ff55a009bc21f4.tar.gz eclipse.platform.swt-203ddea40f3cc9c4394b9ba6e9ff55a009bc21f4.tar.xz eclipse.platform.swt-203ddea40f3cc9c4394b9ba6e9ff55a009bc21f4.zip |
83472
7 files changed, 43 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java index 5518e5316b..4842554905 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java @@ -366,6 +366,10 @@ int colorProc (int inControl, int inMessage, int inDrawDepth, int inDrawInColor) return OS.eventNotHandledErr; } +void checkBuffered () { + style |= SWT.DOUBLE_BUFFERED; +} + /** * Returns the preferred size of the receiver. * <p> @@ -474,6 +478,7 @@ Control computeTabRoot () { void createWidget () { checkOrientation (parent); + checkBuffered (); super.createWidget (); setDefaultFont (); setZOrder (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java index 2d96cadde9..60367bef00 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java @@ -844,6 +844,16 @@ public class SWT { public static final int VIRTUAL = 1 << 28; /** + * Style constant to indicate double buffering (value is 1<<29). + * <p><b>Used By:</b><ul> + * <li><code>Control</code></li> + * </ul></p> + * + * @since 3.1 + */ + public static final int DOUBLE_BUFFERED = 1 << 29; + + /** * Style constant for align up behavior (value is 1<<7, * since align UP and align TOP are considered the same). * <p><b>Used By:</b><ul> diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java index f76133fb8c..897baf253c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java @@ -275,8 +275,17 @@ void createHandle (int index, boolean scrolled) { if ((style & SWT.NO_REDRAW_RESIZE) != 0) { OS.gtk_widget_set_redraw_on_allocate (handle, false); } + /* + * Bug in GTK. When a widget is double buffered and the back + * pixmap is null, the double buffer pixmap is filled with the + * background of the widget rather than the current contents of + * the screen. If nothing is drawn during an expose event, + * the pixels are altered. The fix is to clear double buffering + * and the DOUBLE_BUFFERED flag. + */ if ((style & SWT.NO_BACKGROUND) != 0) { OS.gtk_widget_set_double_buffered (handle, false); + style &= ~SWT.DOUBLE_BUFFERED; } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index 12a6e7ee1b..9c5d7c5a50 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -307,12 +307,17 @@ Control computeTabRoot () { return parent.computeTabRoot (); } +void checkBuffered () { + style |= SWT.DOUBLE_BUFFERED; +} + void checkBorder () { if (getBorderWidth () == 0) style &= ~SWT.BORDER; } void createWidget (int index) { checkOrientation (parent); + checkBuffered (); super.createWidget (index); showWidget (); setInitialBounds (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java index ec2294a475..14967dc814 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java @@ -317,6 +317,9 @@ public void addTraverseListener (TraverseListener listener) { int borderHandle () { return topHandle (); } +void checkBuffered () { + style &= ~SWT.DOUBLE_BUFFERED; +} /** * Returns the preferred size of the receiver. * <p> @@ -424,6 +427,7 @@ Control [] computeTabList () { void createWidget (int index) { checkOrientation (parent); + checkBuffered (); super.createWidget (index); setParentTraversal (); overrideTranslations (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java index dc4aeec2db..9a4f8bd33f 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java @@ -352,6 +352,10 @@ public boolean forceFocus () { return hasFocus (); } +void checkBuffered () { + style &= ~SWT.DOUBLE_BUFFERED; +} + /** * Returns the preferred size of the receiver. * <p> @@ -460,6 +464,7 @@ Control [] computeTabList () { void createWidget (int index) { checkOrientation (parent); + checkBuffered (); super.createWidget (index); setZOrder (); realizeWidget (); 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 00a1dabc98..b2a84da04c 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 @@ -346,6 +346,10 @@ void checkBorder () { if (getBorderWidth () == 0) style &= ~SWT.BORDER; } +void checkBuffered () { + style &= ~SWT.DOUBLE_BUFFERED; +} + boolean checkHandle (int hwnd) { return hwnd == handle; } @@ -490,6 +494,7 @@ void createHandle () { void createWidget () { foreground = background = -1; checkOrientation (parent); + checkBuffered (); createHandle (); register (); subclass (); |