|
@@ -971,15 +971,20 @@ static void wall_draw(int x, int y, unsigned int w, unsigned int h)
|
|
|
const unsigned short *srow = src + (unsigned int)wall_ymap[yy] *
|
|
const unsigned short *srow = src + (unsigned int)wall_ymap[yy] *
|
|
|
wall_w;
|
|
wall_w;
|
|
|
|
|
|
|
|
|
|
+ /* d points at the start of the row; the loops index it with
|
|
|
|
|
+ * absolute screen x. Pointing d at x0 and still indexing with
|
|
|
|
|
+ * x shifted every damage rect's wallpaper right by x0, which
|
|
|
|
|
+ * left old window pixels in the uncovered strip and made
|
|
|
|
|
+ * dragging windows leave a trail. */
|
|
|
if (screen.bpp == 16) {
|
|
if (screen.bpp == 16) {
|
|
|
unsigned short *d = (unsigned short *)(screen.px +
|
|
unsigned short *d = (unsigned short *)(screen.px +
|
|
|
- (unsigned long)yy * screen.pitch) + x0;
|
|
|
|
|
|
|
+ (unsigned long)yy * screen.pitch);
|
|
|
|
|
|
|
|
for (xx = (unsigned int)x0; xx < (unsigned int)x1; xx++)
|
|
for (xx = (unsigned int)x0; xx < (unsigned int)x1; xx++)
|
|
|
d[xx] = srow[wall_xmap[xx]];
|
|
d[xx] = srow[wall_xmap[xx]];
|
|
|
} else if (screen.bpp == 32) {
|
|
} else if (screen.bpp == 32) {
|
|
|
unsigned int *d = (unsigned int *)(screen.px +
|
|
unsigned int *d = (unsigned int *)(screen.px +
|
|
|
- (unsigned long)yy * screen.pitch) + x0;
|
|
|
|
|
|
|
+ (unsigned long)yy * screen.pitch);
|
|
|
|
|
|
|
|
for (xx = (unsigned int)x0; xx < (unsigned int)x1; xx++)
|
|
for (xx = (unsigned int)x0; xx < (unsigned int)x1; xx++)
|
|
|
d[xx] = wall_rgb32[srow[wall_xmap[xx]]];
|
|
d[xx] = wall_rgb32[srow[wall_xmap[xx]]];
|
|
@@ -1379,10 +1384,18 @@ static void move_window_pixels(struct uwin *u, int ox, int oy, int nx, int ny)
|
|
|
draw_rect(pieces[k].x, pieces[k].y, pieces[k].w, pieces[k].h);
|
|
draw_rect(pieces[k].x, pieces[k].y, pieces[k].w, pieces[k].h);
|
|
|
present.count = 0;
|
|
present.count = 0;
|
|
|
present.immediate = 1;
|
|
present.immediate = 1;
|
|
|
- add_rect(&present, nx, ny, u->info.w, u->info.h);
|
|
|
|
|
- for (k = 0; k < np; k++)
|
|
|
|
|
- add_rect(&present, pieces[k].x, pieces[k].y,
|
|
|
|
|
- pieces[k].w, pieces[k].h);
|
|
|
|
|
|
|
+ /* Present the union of the old and new rectangles as one rect.
|
|
|
|
|
+ * The shadow is correct for all of it, and one rect cannot be cut
|
|
|
|
|
+ * off by the kernel's four-entry present list. */
|
|
|
|
|
+ {
|
|
|
|
|
+ int ux0 = ox < nx ? ox : nx;
|
|
|
|
|
+ int uy0 = oy < ny ? oy : ny;
|
|
|
|
|
+ int ux1 = (ox > nx ? ox : nx) + (int)u->info.w;
|
|
|
|
|
+ int uy1 = (oy > ny ? oy : ny) + (int)u->info.h;
|
|
|
|
|
+
|
|
|
|
|
+ add_rect(&present, ux0, uy0, (unsigned int)(ux1 - ux0),
|
|
|
|
|
+ (unsigned int)(uy1 - uy0));
|
|
|
|
|
+ }
|
|
|
wm_overlays(&present);
|
|
wm_overlays(&present);
|
|
|
u_wm_present(&present);
|
|
u_wm_present(&present);
|
|
|
}
|
|
}
|