From b62d3ae87ba5cc4989c18eae06d8fc0662015958 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 4 May 2013 21:14:31 +0000 Subject: 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 --- src/Fl_Gl_Device_Plugin.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fl_Gl_Device_Plugin.cxx b/src/Fl_Gl_Device_Plugin.cxx index 96c977aca..47d3ada7c 100644 --- a/src/Fl_Gl_Device_Plugin.cxx +++ b/src/Fl_Gl_Device_Plugin.cxx @@ -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 -- cgit v1.2.3