From 30786c2ed39ef0e8482b48b6663ffd99fb032ddd Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 6 Jun 2006 08:00:56 +0000 Subject: STR #1310: OS X Quartz support fixed. All test codes now work without complaints fro Quickdraw or CoreGraphics. If no more major bugs are reported for Quartz, I will make Quartz the default over Quickdraw in the next release of FLTK 1. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5178 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Double_Window.cxx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/Fl_Double_Window.cxx') diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx index e1fa64e67..54fd2b935 100644 --- a/src/Fl_Double_Window.cxx +++ b/src/Fl_Double_Window.cxx @@ -219,12 +219,19 @@ void fl_delete_offscreen(Fl_Offscreen ctx) { free(data); } -static CGContextRef prev_gc = 0; -static Window prev_window = 0; +const int stack_max = 16; +static int stack_ix = 0; +static CGContextRef stack_gc[stack_max]; +static Window stack_window[stack_max]; void fl_begin_offscreen(Fl_Offscreen ctx) { - prev_gc = fl_gc; - prev_window = fl_window; + if (stack_ix0) + stack_ix--; + else + fprintf(stderr, "FLTK CGContext Stack underflow error\n"); + if (stack_ix