diff options
author | Patrick Luby <pluby@openoffice.org> | 2001-02-20 21:01:10 +0000 |
---|---|---|
committer | Patrick Luby <pluby@openoffice.org> | 2001-02-20 21:01:10 +0000 |
commit | 1c723ac19949d88a958fa092af85fc39264ee46d (patch) | |
tree | 49f2c111e5df19eaf13034b6a5a1b4263865568f /vcl/aqua/source/gdi/salvd.cxx | |
parent | 5347387f31cf634977d5a779755a26a6f1d3af2f (diff) |
Implemented workaround for QuickDraw bug. The bug was that GWorld's created before the first window was displayed would cause QuickDraw to core dump when drawn to.
Diffstat (limited to 'vcl/aqua/source/gdi/salvd.cxx')
-rw-r--r-- | vcl/aqua/source/gdi/salvd.cxx | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx index fc4ae00ea51a..b651a745c5e4 100644 --- a/vcl/aqua/source/gdi/salvd.cxx +++ b/vcl/aqua/source/gdi/salvd.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salvd.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: bmahbod $ $Date: 2001-02-14 19:39:49 $ + * last change: $Author: pluby $ $Date: 2001-02-20 22:01:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,7 +94,7 @@ static BOOL InitVirtualDeviceGWorld ( SalVirDevDataPtr rSalVirDevData ) GWorldPtr pGWorld = NULL; CTabHandle hCTable = NULL; GDHandle hGDevice = NULL; - GWorldFlags nFlags = noErr; + GWorldFlags nFlags = noNewDevice; OSStatus nOSStatus = noErr; // Set the dimensions of the GWorldPtr @@ -111,6 +111,20 @@ static BOOL InitVirtualDeviceGWorld ( SalVirDevDataPtr rSalVirDevData ) nFlags ); + // If NewGWorld failed, try again with different flags + + if ( nOSStatus != noErr ) + { + nFlags = noErr; + nOSStatus = NewGWorld( &pGWorld, + nPixelDepth, + &aBoundsRect, + hCTable, + hGDevice, + nFlags + ); + } // if + if ( ( nOSStatus == noErr ) && ( pGWorld != NULL ) ) @@ -216,9 +230,13 @@ SalGraphics* SalVirtualDevice::GetGraphics() maVirDevData.mpGraphics = new SalGraphics; maVirDevData.mbGraphics = InitVirtualDeviceGWorld( &maVirDevData ); - } // if - maVirDevData.mbGraphics = TRUE; + if ( !maVirDevData.mbGraphics ) + { + delete maVirDevData.mpGraphics; + maVirDevData.mpGraphics = NULL; + } // if + } // if return maVirDevData.mpGraphics; } // SalVirtualDevice::GetGraphics |