# HG changeset patch # User John W. Eaton # Date 1297065171 18000 # Node ID a8cd6ea06d36bf6ea8d1f1ade4b6a7fe63e80296 # Parent 824b3e0ab12a237ba1e69450fe963d490aa5c534 fltk: avoid showing canvas if figure is not visible diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-02-07 John W. Eaton + + * DLD-FUNCTIONS/__init_fltk__.cc (plot_window::show_canvas): + Don't do anything if figure is not visible. + (plot_window::hide_canvas): Also make canvas current. + 2011-02-06 Konstantinos Poulios * graphics.h.in (class axes::properties): Tag positionmode, diff --git a/src/DLD-FUNCTIONS/__init_fltk__.cc b/src/DLD-FUNCTIONS/__init_fltk__.cc --- a/src/DLD-FUNCTIONS/__init_fltk__.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -717,9 +717,11 @@ // This allows us to have a valid OpenGL context right away. canvas->mode (FL_DEPTH | FL_DOUBLE ); + if (fp.is_visible ()) { show (); + if (fp.get_currentaxes ().ok()) show_canvas (); else @@ -853,12 +855,16 @@ void show_canvas (void) { - canvas->show (); - canvas->make_current (); + if (fp.is_visible ()) + { + canvas->show (); + canvas->make_current (); + } } void hide_canvas (void) { + canvas->make_current (); canvas->hide (); }