print_gl_window(): it's safer to memorize and restore the value of the fl_window global variable.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9909 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2013-05-04 21:14:31 +00:00
parent a2d821cc2e
commit b62d3ae87b

View File

@ -45,6 +45,7 @@ static void print_gl_window(Fl_Gl_Window *glw, int x, int y, int height)
const int bytesperpixel = 3;
#endif
Fl_Surface_Device *save_surface = Fl_Surface_Device::surface();
Window save_window = fl_window;
fl_gc = NULL;
Fl_Display_Device::display_device()->set_current();
#ifdef WIN32
@ -82,7 +83,8 @@ static void print_gl_window(Fl_Gl_Window *glw, int x, int y, int height)
#endif
baseAddress);
glPopClientAttrib();
save_surface->set_current();
save_surface->Fl_Surface_Device::set_current();
fl_window = save_window;
fl_gc = save_gc;
#if defined(__APPLE__)
// kCGBitmapByteOrder32Host and CGBitmapInfo are supposed to arrive with 10.4