[3766] in Athena Bugs

home help back first fref pref prev next nref lref last post

xwd, 6.3B, RT and VAX

daemon@ATHENA.MIT.EDU (Chris VanHaren)
Sat Dec 2 16:40:55 1989

To: bugs@ATHENA.MIT.EDU
Cc: web@ATHENA.MIT.EDU, vanharen@ATHENA.MIT.EDU
In-Reply-To: 
From: vanharen@MIT.EDU (Chris VanHaren)
Date: Sat, 02 Dec 89 16:40:19 EST
Summary:
--------
XWD has a bug in the logic for dumping windows without borders (using
the "-nobdrs" option), and the same logic causes a failure when dumping
windows that are partially off-screen.  If not using the "-nobdrs"
option, all is fine.

In more detail:
---------------
When using the "-nobdrs" option,

	(1) If the window is on the screen, the window produced does not
have the right-hand or the bottom border removed, and the top and left
edges of the window are cropped by the width of the border.

	(2) If the window is partially off the right-hand or bottom of
the screen, xwd fails with an X Protocol error because it is attempting
to get an image that is partially off-screen.

Fix:
----
Context diffs are provided below.  Tested, and works on both RT and VAX
platforms.  This should also be forwarded to the X Consortium.

						-Chris.

==============================================================================
==============================================================================
*** xwd.c       Sat Dec  2 15:51:01 1989
--- /mit/x11/src/clients/xwd/xwd.c      Sun May 21 11:39:27 1989
***************
*** 208,215 ****
       * Snarf the pixmap with XGetImage.
       */

!     x = absx - win_info.x - win_info.border_width;
!     y = absy - win_info.y - win_info.border_width;
      image = XGetImage (dpy, window, x, y, width, height, AllPlanes, format);
      if (!image) {
        fprintf (stderr, "%s:  unable to get image at %dx%d+%d+%d\n",
--- 208,216 ----
       * Snarf the pixmap with XGetImage.
       */

!     bw = nobdrs ? 0 : win_info.border_width;
!     x = absx - win_info.x - bw;
!     y = absy - win_info.y - bw;
      image = XGetImage (dpy, window, x, y, width, height, AllPlanes, format);
      if (!image) {
        fprintf (stderr, "%s:  unable to get image at %dx%d+%d+%d\n",

home help back first fref pref prev next nref lref last post