summaryrefslogtreecommitdiff
path: root/src/Fl_Double_Window.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2007-02-08 20:50:01 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2007-02-08 20:50:01 +0000
commit3d11948876f02939fbbe81a3e24e8a8d6a42e4f2 (patch)
tree4c9c05c6e911ce4571d19b112f203d28df3dab6f /src/Fl_Double_Window.cxx
parente173e7bec0961bbc5cc972b6fe1d3d9721c8c5b6 (diff)
Try a slightly different Xdbe implementation that copies instead of swaps.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5679 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Double_Window.cxx')
-rw-r--r--src/Fl_Double_Window.cxx33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx
index 29a3b2599..76474078c 100644
--- a/src/Fl_Double_Window.cxx
+++ b/src/Fl_Double_Window.cxx
@@ -338,9 +338,11 @@ void Fl_Double_Window::flush(int eraseoverlay) {
Fl_X *myi = Fl_X::i(this);
if (!myi->other_xid) {
#if USE_XDBE
- if (can_xdbe()) myi->other_xid =
- XdbeAllocateBackBufferName(fl_display, fl_xid(this), XdbeUndefined);
- else
+ if (can_xdbe()) {
+ myi->other_xid =
+ XdbeAllocateBackBufferName(fl_display, fl_xid(this), XdbeCopied);
+ myi->backbuffer_bad = 1;
+ } else
#endif
#ifdef __APPLE_QD__
if ( ( !QDIsPortBuffered( GetWindowPort(myi->xid) ) )
@@ -360,28 +362,27 @@ void Fl_Double_Window::flush(int eraseoverlay) {
}
#if USE_XDBE
if (use_xdbe) {
- // if this is true, copy rather than swap so back buffer is preserved:
- int copy = (myi->region || eraseoverlay);
- if (myi->backbuffer_bad) { // make sure we do a complete redraw...
+ if (myi->backbuffer_bad) {
+ // Make sure we do a complete redraw...
if (myi->region) {XDestroyRegion(myi->region); myi->region = 0;}
clear_damage(FL_DAMAGE_ALL);
+ myi->backbuffer_bad = 0;
}
+
+ // Redraw as needed...
if (damage()) {
fl_clip_region(myi->region); myi->region = 0;
fl_window = myi->other_xid;
draw();
fl_window = myi->xid;
}
- if (!copy) {
- XdbeSwapInfo s;
- s.swap_window = fl_xid(this);
- s.swap_action = XdbeUndefined;
- XdbeSwapBuffers(fl_display, &s, 1);
- myi->backbuffer_bad = 1;
- return;
- }
- // otherwise just use normal copy from back to front:
- myi->backbuffer_bad = 0; // which won't destroy the back buffer...
+
+ // Copy contents of back buffer to window...
+ XdbeSwapInfo s;
+ s.swap_window = fl_xid(this);
+ s.swap_action = XdbeCopied;
+ XdbeSwapBuffers(fl_display, &s, 1);
+ return;
} else
#endif
if (damage() & ~FL_DAMAGE_EXPOSE) {