if FIX_BROKEN_TILED_FILL is defined disable all graphic operations with gctiled GC (set function to GXnoop) - Also clear selection rectangle with MyXCopyArea in select_rect()

This commit is contained in:
stefan schippers 2023-09-22 01:12:26 +02:00
parent fbe3064cf2
commit 4ea2ccac4c
2 changed files with 23 additions and 0 deletions

View File

@ -3375,7 +3375,16 @@ void select_rect(int what, int select)
else if(what & END)
{
RECTORDER(xctx->nl_xr,xctx->nl_yr,xctx->nl_xr2,xctx->nl_yr2);
#if defined(FIX_BROKEN_TILED_FILL)
MyXCopyArea(display, xctx->save_pixmap, xctx->window, xctx->gc[0], xctx->xrect[0].x, xctx->xrect[0].y,
xctx->xrect[0].width, xctx->xrect[0].height, xctx->xrect[0].x, xctx->xrect[0].y);
#else
drawtemprect(xctx->gctiled, NOW, xctx->nl_xr,xctx->nl_yr,xctx->nl_xr2,xctx->nl_yr2);
#endif
/* draw_selection(xctx->gc[SELLAYER], 0); */
select_inside(xctx->nl_xr,xctx->nl_yr,xctx->nl_xr2,xctx->nl_yr2, xctx->nl_sel);

View File

@ -2094,6 +2094,11 @@ void resetwin(int create_pixmap, int clear_pixmap, int force, int w, int h)
XFreeGC(display,xctx->gctiled);
}
if(create_pixmap) {
#if defined(FIX_BROKEN_TILED_FILL)
XGCValues gcv;
unsigned long gcvm;
#endif
#ifdef __unix__
xctx->save_pixmap = XCreatePixmap(display, xctx->window,
xctx->xrect[0].width, xctx->xrect[0].height, screendepth);
@ -2101,9 +2106,18 @@ void resetwin(int create_pixmap, int clear_pixmap, int force, int w, int h)
xctx->save_pixmap = Tk_GetPixmap(display, xctx->window,
xctx->xrect[0].width, xctx->xrect[0].height, screendepth);
#endif
#if defined(FIX_BROKEN_TILED_FILL)
gcv.function = GXnoop; /* disable all graphic operations with gctiled */
gcvm = GCFunction;
xctx->gctiled = XCreateGC(display,xctx->window, gcvm, &gcv); /* noop for gctiled */
XSetFillStyle(display,xctx->gctiled,FillSolid);
#else
xctx->gctiled = XCreateGC(display,xctx->window,0L, NULL);
XSetTile(display,xctx->gctiled, xctx->save_pixmap);
XSetFillStyle(display,xctx->gctiled,FillTiled);
#endif
/* whenever a pixmap is recreated all GC attributes must be reissued */
resetcairo(1, 0, 1); /* create, clear, force */
/* change_linewidth(-1.0); */