From: <hba...@us...> - 2010-05-30 15:50:01
|
Revision: 11035 http://plplot.svn.sourceforge.net/plplot/?rev=11035&view=rev Author: hbabcock Date: 2010-05-30 15:49:54 +0000 (Sun, 30 May 2010) Log Message: ----------- Change xcairo driver so that its behavior matches that of the qtwidget driver when the window close box is clicked. Modified Paths: -------------- trunk/drivers/cairo.c Modified: trunk/drivers/cairo.c =================================================================== --- trunk/drivers/cairo.c 2010-05-30 15:35:50 UTC (rev 11034) +++ trunk/drivers/cairo.c 2010-05-30 15:49:54 UTC (rev 11035) @@ -119,6 +119,7 @@ Display *XDisplay; Window XWindow; unsigned int xdrawable_mode; + short window_closed; #endif #if defined ( PLD_memcairo ) unsigned char *memory; @@ -1642,6 +1643,9 @@ XFlush( aStream->XDisplay ); + /* set window as not closed. */ + aStream->window_closed = 0; + return 0; } @@ -1734,6 +1738,9 @@ plD_bop_cairo( pls ); + if ( aStream->window_closed ) + return; + if ( aStream->xdrawable_mode ) return; @@ -1761,6 +1768,9 @@ aStream = (PLCairo *) pls->dev; + if ( aStream->window_closed ) + return; + /* Blit the offscreen image to the X window. */ blit_to_x( aStream, 0.0, 0.0, pls->xlength, pls->ylength ); @@ -1793,7 +1803,9 @@ aStream->exit_event_loop = 1; break; case ClientMessage: - aStream->exit_event_loop = 1; + // plexit("X Window closed"); + aStream->window_closed = 1; + aStream->exit_event_loop = 1; break; case Expose: /* Blit the image again after an expose event, but only for the last This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |