diff --git a/ChangeLog b/ChangeLog index b99c90f..3e391f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3897,3 +3897,10 @@ Sun Sep 17 11:51:16 PDT 2000 Michael Jennings Added ability to track Imlib2-created pixmaps via libmej. ------------------------------------------------------------------------------- +Sun Sep 17 13:05:13 PDT 2000 Michael Jennings + + When shaded, rely on Enlightenment rather than X for accurate x/y + position information. This fixes a bug pointed out by Gnea + . + +------------------------------------------------------------------------------- diff --git a/src/pixmap.c b/src/pixmap.c index 2b0ad95..e9a857b 100644 --- a/src/pixmap.c +++ b/src/pixmap.c @@ -38,15 +38,16 @@ static const char cvs_ident[] = "$Id$"; # include #endif +#include "command.h" #include "draw.h" #include "e.h" #include "icon.h" -#include "startup.h" #include "menus.h" #include "options.h" #include "pixmap.h" #include "screen.h" #include "scrollbar.h" +#include "startup.h" #include "term.h" #include "windows.h" @@ -511,7 +512,15 @@ create_trans_pixmap(simage_t *simg, unsigned char which, Drawable d, int x, int D_PIXMAP(("update_desktop_info() failed.\n")); return None; } - XTranslateCoordinates(Xdisplay, d, desktop_window, x, y, &x, &y, &dummy); + if (refresh_type == NO_REFRESH) { + /* If we're hidden/shaded, translated coordinates to be parent relative, then use the + internal cache data to tell where we are on the desktop. Otherwise, just ask X. */ + XTranslateCoordinates(Xdisplay, d, TermWin.parent, x, y, &x, &y, &dummy); + x += TermWin.x; + y += TermWin.y; + } else { + XTranslateCoordinates(Xdisplay, d, desktop_window, x, y, &x, &y, &dummy); + } p = LIBMEJ_X_CREATE_PIXMAP(width, height); gc = LIBMEJ_X_CREATE_GC(0, NULL); 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)); diff --git a/src/windows.c b/src/windows.c index 2f2126a..bc28b67 100644 --- a/src/windows.c +++ b/src/windows.c @@ -605,11 +605,11 @@ void handle_move(int x, int y) { if ((TermWin.x != x) || (TermWin.y != y)) { + TermWin.x = x; + TermWin.y = y; if (image_mode_any(MODE_TRANS | MODE_VIEWPORT)) { redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT); } - TermWin.x = x; - TermWin.y = y; } }