Skip to content

Commit

Permalink
BUG FIX with window restoration on Mac OS, now restore from the X-Win…
Browse files Browse the repository at this point in the history
…dow pixmap buffer, not from the window directly; fixes #54
  • Loading branch information
danieljprice committed Dec 1, 2024
1 parent f0ca92a commit fbcd541
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/giza-band.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/giza-driver-xw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/giza-drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fbcd541

Please sign in to comment.