From 62f9813e4ed6a001848d3c31b72f3d48d48df774 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Thu, 31 Mar 2016 05:01:22 +0000 Subject: Fix error with PostScript driver on the Mac platform. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11481 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/drivers') diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 9f0b497ff..c202da51f 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -98,6 +98,7 @@ void Fl_Cocoa_Window_Driver::flush_overlay() void Fl_Cocoa_Window_Driver::draw_begin() { + if (!Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) return; CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); if (shape_data_) { # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 @@ -118,8 +119,7 @@ void Fl_Cocoa_Window_Driver::draw_end() { // on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right // corner. This code draws a little ribbed triangle for dragging. - CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); - if (fl_mac_os_version < 100700 && gc && !parent() && pWindow->resizable() && + if (fl_mac_os_version < 100700 && !parent() && pWindow->resizable() && (!size_range_set() || minh() != maxh() || minw() != maxw())) { int dx = Fl::box_dw(pWindow->box())-Fl::box_dx(pWindow->box()); int dy = Fl::box_dh(pWindow->box())-Fl::box_dy(pWindow->box()); @@ -139,7 +139,10 @@ void Fl_Cocoa_Window_Driver::draw_end() } } # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 - if (shape_data_) CGContextRestoreGState(gc); + if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) { + CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); + if (shape_data_) CGContextRestoreGState(gc); + } # endif } -- cgit v1.2.3