summaryrefslogtreecommitdiff
path: root/src/Fl.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2014-02-07 00:09:52 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2014-02-07 00:09:52 +0000
commitef952dfa5366cb4c7a7109b63629ea02a7fc576d (patch)
tree613c87704170f3581fe34b11df1b2ca26e69e718 /src/Fl.cxx
parent74aeae38cb3a4695542ec39f2432841a2567a007 (diff)
Fix crash when Fl_Window::flush() is called before show() (STR #3028).
The fix is twofold: (1) if Fl_Window::flush() is called, this is ignored silently (2) if Fl_Window::make_current() is called directly, but the window is currently not shown(), then the program will be terminated with an error message. The latter is necessary because returning from make_current() would leave the program in a state where it would expect to have a valid drawing context. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10095 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl.cxx')
-rw-r--r--src/Fl.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index fcb16555d..1916052ce 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -1750,6 +1750,7 @@ void Fl_Widget::damage(uchar fl, int X, int Y, int W, int H) {
Fl::damage(FL_DAMAGE_CHILD);
}
void Fl_Window::flush() {
+ if (!shown()) return;
make_current();
//if (damage() == FL_DAMAGE_EXPOSE && can_boxcheat(box())) fl_boxcheat = this;
fl_clip_region(i->region); i->region = 0;