Browse Source

Fl_Double_Window fix bug with expose handling..

tags/v1.3.1000
Jonathan Moore Liles 13 years ago
parent
commit
9ed50142b8
3 changed files with 28 additions and 4 deletions
  1. +2
    -0
      src/Fl.cxx
  2. +23
    -1
      src/Fl_Double_Window.cxx
  3. +3
    -3
      src/fl_rect.cxx

+ 2
- 0
src/Fl.cxx View File

@@ -1701,7 +1701,9 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
void Fl_Window::flush() {
make_current();
//if (damage() == FL_DAMAGE_EXPOSE && can_boxcheat(box())) fl_boxcheat = this;
/* FIXME: shouldn't this destroy the region? */
fl_clip_region(i->region); i->region = 0;

draw();
}



+ 23
- 1
src/Fl_Double_Window.cxx View File

@@ -374,6 +374,9 @@ void Fl_Double_Window::flush(int eraseoverlay) {
Fl::cairo_set_drawable( this );
#endif
draw();
#if FLTK_HAVE_CAIRO
cairo_surface_flush( myi->cs );
#endif

fl_window = myi->xid;
@@ -391,8 +394,11 @@ void Fl_Double_Window::flush(int eraseoverlay) {
return;
} else
#endif

fl_clip_region(myi->region);

if (damage() & ~FL_DAMAGE_EXPOSE) {
fl_clip_region(myi->region); myi->region = 0;
#ifdef WIN32
HDC _sgc = fl_gc;
fl_gc = fl_makeDC(myi->other_xid);
@@ -407,6 +413,7 @@ void Fl_Double_Window::flush(int eraseoverlay) {
fl_begin_offscreen( myi->other_xid );
fl_clip_region( 0 );
draw();

fl_end_offscreen();
} else {
draw();
@@ -416,8 +423,20 @@ void Fl_Double_Window::flush(int eraseoverlay) {
#if FLTK_HAVE_CAIRO
Fl::cairo_set_drawable( this );
#endif
fl_clip_region(myi->region);

draw();

#if FLTK_HAVE_CAIRO
cairo_surface_flush( myi->cs );
#endif

fl_window = myi->xid;

Fl::cairo_set_drawable( this );

fl_clip_region(myi->region);

#endif
}
if (eraseoverlay) fl_clip_region(0);
@@ -430,6 +449,9 @@ void Fl_Double_Window::flush(int eraseoverlay) {
int X,Y,W,H; fl_clip_box(0,0,w(),h(),X,Y,W,H);
if (myi->other_xid) fl_copy_offscreen(X, Y, W, H, myi->other_xid, X, Y);
}

myi->region = 0;

}

void Fl_Double_Window::resize(int X,int Y,int W,int H) {


+ 3
- 3
src/fl_rect.cxx View File

@@ -556,7 +556,7 @@ void Fl_Graphics_Driver::restore_clip() {

void Fl_Graphics_Driver::clip_region(Fl_Region r) {
Fl_Region oldr = rstack[rstackptr];
if (oldr) XDestroyRegion(oldr);
if (oldr && r != oldr ) XDestroyRegion(oldr);
rstack[rstackptr] = r;
fl_restore_clip();
}
@@ -654,10 +654,10 @@ int Fl_Graphics_Driver::clip_box(int x, int y, int w, int h, int& X, int& Y, int
if (!r) return 0;
#if defined(USE_X11)
switch (XRectInRegion(r, x, y, w, h)) {
case 0: // completely outside
case RectangleOut: // completely outside
W = H = 0;
return 2;
case 1: // completely inside:
case RectangleIn: // completely inside:
return 0;
default: // partial:
break;


Loading…
Cancel
Save