From fbcd54144ec8c5e794c8e521609e14d2b4bc5fed Mon Sep 17 00:00:00 2001 From: Daniel Price Date: Mon, 2 Dec 2024 09:44:15 +1100 Subject: [PATCH] BUG FIX with window restoration on Mac OS, now restore from the X-Window pixmap buffer, not from the window directly; fixes #54 --- src/giza-band.c | 1 + src/giza-driver-xw.c | 4 +++- src/giza-drivers.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/giza-band.c b/src/giza-band.c index 2a529bf..be3ae7a 100644 --- a/src/giza-band.c +++ b/src/giza-band.c @@ -114,6 +114,7 @@ _giza_refresh_band (int mode, int nanc, const int *xanc, const int *yanc, int x2 /* Draw over the old band */ cairo_paint (Band.restore); + giza_flush_device(); /* int topleftx = x1 - 10; diff --git a/src/giza-driver-xw.c b/src/giza-driver-xw.c index c7e2a4f..12171bc 100644 --- a/src/giza-driver-xw.c +++ b/src/giza-driver-xw.c @@ -604,8 +604,10 @@ _giza_init_band_xw (void) /* use grey for band */ cairo_set_source_rgba (Band.box, 0.5, 0.5, 0.5, 1.0); - /* Set up restore to remove box */ + /* Set up restore to remove box (DP: 2/12/24 we now restore from pixmap instead of window to fix issue on Mac OS)*/ + Band.onscreen = cairo_xlib_surface_create (XW[id].display, XW[id].pixmap, XW[id].visual, XW[id].width, XW[id].height); Band.restore = cairo_create (Band.onscreen); + cairo_set_source_surface (Band.restore, Dev[id].surface, 0, 0); Band.maxHeight = XW[id].height; Band.maxWidth = XW[id].width; diff --git a/src/giza-drivers.c b/src/giza-drivers.c index 21fbc3e..027fe62 100644 --- a/src/giza-drivers.c +++ b/src/giza-drivers.c @@ -1164,7 +1164,7 @@ _giza_init_band (int mode) #endif default: _giza_error ("_giza_init_band", "band not implemented for this device"); - break; + break; } _giza_set_line_style (Band.ls, Band.box); double lwDevice = Band.lw * Dev[id].deviceUnitsPermm * 0.25;