From: <and...@us...> - 2011-05-06 20:24:16
|
Revision: 11746 http://plplot.svn.sourceforge.net/plplot/?rev=11746&view=rev Author: andrewross Date: 2011-05-06 20:24:10 +0000 (Fri, 06 May 2011) Log Message: ----------- Changes to xwin driver to cache the background colour of the page so colour is correct if page is resized / redrawn. Modified Paths: -------------- trunk/drivers/xwin.c trunk/include/plxwd.h Modified: trunk/drivers/xwin.c =================================================================== --- trunk/drivers/xwin.c 2011-05-06 20:00:50 UTC (rev 11745) +++ trunk/drivers/xwin.c 2011-05-06 20:24:10 UTC (rev 11746) @@ -518,15 +518,17 @@ pthread_mutex_lock( &events_mutex ); #endif + dev->bgcolor = xwd->cmap0[0]; + if ( dev->write_to_window ) { - XSetWindowBackground( xwd->display, dev->window, xwd->cmap0[0].pixel ); - XSetBackground( xwd->display, dev->gc, xwd->cmap0[0].pixel ); + XSetWindowBackground( xwd->display, dev->window, dev->bgcolor.pixel ); + XSetBackground( xwd->display, dev->gc, dev->bgcolor.pixel ); XClearWindow( xwd->display, dev->window ); } if ( dev->write_to_pixmap ) { - XSetForeground( xwd->display, dev->gc, xwd->cmap0[0].pixel ); + XSetForeground( xwd->display, dev->gc, dev->bgcolor.pixel ); XFillRectangle( xwd->display, dev->pixmap, dev->gc, 0, 0, dev->width, dev->height ); XSetForeground( xwd->display, dev->gc, dev->curcolor.pixel ); @@ -2371,7 +2373,16 @@ // Initialize & redraw (to pixmap, if available). - plD_bop_xw( pls ); + if ( dev->write_to_pixmap ) + { + XSetForeground( xwd->display, dev->gc, dev->bgcolor.pixel ); + XFillRectangle( xwd->display, dev->pixmap, dev->gc, 0, 0, + dev->width, dev->height ); + XSetForeground( xwd->display, dev->gc, dev->curcolor.pixel ); + } + if ( dev->write_to_window ) { + XClearWindow( xwd->display, dev->window ); + } plRemakePlot( pls ); XSync( xwd->display, 0 ); @@ -2445,10 +2456,16 @@ // Initialize & redraw (to pixmap, if available). - if ( dev->write_to_pixmap ) + if ( dev->write_to_pixmap ) { dev->write_to_window = 0; - - plD_bop_xw( pls ); + XSetForeground( xwd->display, dev->gc, dev->bgcolor.pixel ); + XFillRectangle( xwd->display, dev->pixmap, dev->gc, 0, 0, + dev->width, dev->height ); + XSetForeground( xwd->display, dev->gc, dev->curcolor.pixel ); + } + if ( dev->write_to_window ) { + XClearWindow( xwd->display, dev->window ); + } plRemakePlot( pls ); XSync( xwd->display, 0 ); Modified: trunk/include/plxwd.h =================================================================== --- trunk/include/plxwd.h 2011-05-06 20:00:50 UTC (rev 11745) +++ trunk/include/plxwd.h 2011-05-06 20:24:10 UTC (rev 11746) @@ -107,6 +107,7 @@ #ifdef PL_HAVE_PTHREAD pthread_t updater; // The X events updater thread id #endif + XColor bgcolor; // Background color } XwDev; #endif // __PLXWD_H__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |