diff options
author | Michael Jennings <mej@kainx.org> | 2006-05-17 19:42:39 +0000 |
---|---|---|
committer | Michael Jennings <mej@kainx.org> | 2006-05-17 19:42:39 +0000 |
commit | cc5392df86d76963277548bf90f0aec10d234325 (patch) | |
tree | 63ccae70678d61380d2f89267e11121e8ce10163 /src | |
parent | e7117e77bf4437be4f57c94cbb3fdb80a617ef99 (diff) | |
download | eterm-cc5392df86d76963277548bf90f0aec10d234325.tar.gz |
Wed May 17 15:42:28 2006 Michael Jennings (mej)
Patch from Kim Woelders <kim@woelders.dk> to optimize transparent
Eterms moved an even multiple of the desktop size (i.e., to another
desktop area).
----------------------------------------------------------------------
SVN revision: 22674
Diffstat (limited to 'src')
-rw-r--r-- | src/pixmap.c | 16 | ||||
-rw-r--r-- | src/windows.c | 10 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/pixmap.c b/src/pixmap.c index 609e82f..24b01d4 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -686,17 +686,11 @@ create_trans_pixmap(simage_t *simg, unsigned char which, Drawable d, int x, int D_PIXMAP(("Created p [0x%08x] as a %hux%hu pixmap at %d, %d relative to window 0x%08x\n", p, width, height, x, y, desktop_window)); if (p != None) { - if (pw < scr->width || ph < scr->height) { - D_PIXMAP(("Tiling %ux%u desktop pixmap 0x%08x onto p.\n", pw, ph, desktop_pixmap)); - XSetTile(Xdisplay, gc, desktop_pixmap); - XSetTSOrigin(Xdisplay, gc, pw - (x % pw), ph - (y % ph)); - XSetFillStyle(Xdisplay, gc, FillTiled); - XFillRectangle(Xdisplay, p, gc, 0, 0, width, height); - } else { - D_PIXMAP(("Copying %hux%hu rectangle at %d, %d from %ux%u desktop pixmap 0x%08x onto p.\n", width, height, x, y, pw, ph, - desktop_pixmap)); - XCopyArea(Xdisplay, desktop_pixmap, p, gc, x, y, width, height, 0, 0); - } + D_PIXMAP(("Tiling %ux%u desktop pixmap 0x%08x onto p.\n", pw, ph, desktop_pixmap)); + XSetTile(Xdisplay, gc, desktop_pixmap); + XSetTSOrigin(Xdisplay, gc, pw - (x % pw), ph - (y % ph)); + XSetFillStyle(Xdisplay, gc, FillTiled); + XFillRectangle(Xdisplay, p, gc, 0, 0, width, height); if ((which != image_bg || (BITFIELD_IS_SET(image_options, IMAGE_OPTIONS_ITRANS)) || images[image_bg].current != images[image_bg].norm) && need_colormod(simg->iml)) { diff --git a/src/windows.c b/src/windows.c index 5005bec..c0c6435 100644 --- a/src/windows.c +++ b/src/windows.c @@ -691,11 +691,19 @@ handle_resize(unsigned int width, unsigned int height) void handle_move(int x, int y) { + int dx, dy; + if ((TermWin.x != x) || (TermWin.y != y)) { + dx = abs(TermWin.x - x); + dy = abs(TermWin.y - y); TermWin.x = x; TermWin.y = y; + /* If we've moved an even multiple of the screen size, there's no + need to redraw trans/viewport images; the images will line up. */ if (image_mode_any(MODE_TRANS | MODE_VIEWPORT)) { - redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT); + if ((dx % DisplayWidth(Xdisplay, Xscreen)) || (dy % DisplayHeight(Xdisplay, Xscreen))) { + redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT); + } } } } |