mirror of
https://github.com/fltk/fltk.git
synced 2026-05-25 00:53:39 +08:00
Fix a fluid crash when writing a template screenshot
We need to show() the window before we call fl_read_image() if it is not shown yet, otherwise fluid would crash.
This commit is contained in:
@@ -425,8 +425,14 @@ void Fl_Window_Type::open() {
|
||||
uchar *Fl_Window_Type::read_image(int &ww, int &hh) {
|
||||
Overlay_Window *w = (Overlay_Window *)o;
|
||||
|
||||
int hidden = !w->shown();
|
||||
w->show(); // make it the front window
|
||||
|
||||
// Read the screen image...
|
||||
return (w->read_image(ww, hh));
|
||||
uchar *idata = w->read_image(ww, hh);
|
||||
if (hidden)
|
||||
w->hide();
|
||||
return idata;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user