>
> David's workaround was to do:
>
>    myi->other_xid = ( w() && h() ? fl_create_offscreen(w(),h()) : 0 );
>
> instead, i.e. only create the offscreen surface for the double
> buffering of the window if the window has non-zero size. Otherwise,
> other_xid is set to NULL.
>
> It looks like *most* other places where other_xid is used, it is
> checkedfor being NULL first, so this ought to be safe.
>
> David reports good results with this workaround in his tests,
> though I was initially sceptical.
> I'm now of the opinion that this workaround is probably good,
> though we need to check there are no places where other_xid is
> actually used without
> first being checked for NULL, just to be sure!
>

I double check, and find an global variable initialize with this value.
Using nested double window using box can trigger X error. (PolySegment, and 
PolyText).

Here my full patch :
    // Checking against 0 is not enough
    myi->other_xid = ( w() >= 0 && h() >= 0 ? fl_create_offscreen(w(), h()) : 0 
);

and (near line 416 of Fl_Double_Window.cxx)

#else // X:
    fl_window = myi->other_xid;
    draw();
    fl_window = myi->xid;
#endif

is replaced by


#else // X:
    if ( myi->other_xid ) {
      // global init of the current X window
      fl_window = myi->other_xid;
      draw();
    }
    fl_window = myi->xid;
#endif


_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to