From cc5392df86d76963277548bf90f0aec10d234325 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Wed, 17 May 2006 19:42:39 +0000 Subject: Wed May 17 15:42:28 2006 Michael Jennings (mej) Patch from Kim Woelders to optimize transparent Eterms moved an even multiple of the desktop size (i.e., to another desktop area). ---------------------------------------------------------------------- SVN revision: 22674 --- ChangeLog | 6 ++++++ src/pixmap.c | 16 +++++----------- src/windows.c | 10 +++++++++- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2ea812..acdf3e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5481,3 +5481,9 @@ Fri Feb 24 16:58:43 2006 Michael Jennings (mej) Add fallback attempt to open display in case NEED_LINUX_HACK is set and shouldn't be. ---------------------------------------------------------------------- +Wed May 17 15:42:28 2006 Michael Jennings (mej) + +Patch from Kim Woelders to optimize transparent +Eterms moved an even multiple of the desktop size (i.e., to another +desktop area). +---------------------------------------------------------------------- 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); + } } } } -- cgit v1.2.1