From: tmcconne@sedona.intel.com (Tom McConnell)
Subject: Re: Using `xv` in conjunction with `tvtwm` for backgrounds
Originator: tmcconne@sedona
Reply-To: tmcconne@sedona.intel.com
Organization: Intel Corporation
Date: Sun, 26 Jul 1992 19:09:24 GMT


In article <RATINOX.92Jul25205045@splinter.coe.northeastern.edu>, ratinox@splinter.coe.northeastern.edu (Richard Pieri/Stainless Steel Rat) writes:
> >>>>> On 24 Jul 92 20:00:06 GMT, naren@cs.UAlberta.CA (Narendra Ravi) said:
> 
> NR> Has anyone managed to use xv instead of xloadimage for loading pixmaps in
> NR> tvtwm?
> 
> No, it won't work. Unless you can find a way to compile in "xv -root" into
> the tvtwm binaries (which I have to date been unable) instead of "xloadimage."

  Relatively easy :)

  The code is in vdt.c:

thunder> diff -c2 vdt.c_orig vdt.c 
*** vdt.c_orig  Sun Jul 26 11:38:51 1992
--- vdt.c       Sun Jul 26 12:01:12 1992
***************
*** 559,566 ****
                if (fres < 0) fprintf(stderr, "%s: error in fork()...\n");
                if (fres == 0) {                /* This is the child */
!                       execlp("xloadimage", "xsetbg", "-display",
                                XDisplayName(display_name), Scr->vdtPixmap, NULL);
!                       /* No xloadimage in path, call it explicitly... */
!                       execlp(XLOADIMAGE, "xsetbg", "-display",
                                XDisplayName(display_name), Scr->vdtPixmap, NULL);
                        /* Give up, you don't get a background... */
--- 559,567 ----
                if (fres < 0) fprintf(stderr, "%s: error in fork()...\n");
                if (fres == 0) {                /* This is the child */
!                       execlp(XLOADIMAGE, "xsetbg", XLOADIMAGE_OPTIONS, "-display",
                                XDisplayName(display_name), Scr->vdtPixmap, NULL);
!                       execlp("xv", "xsetbg", "-root", "-quit", "-display",
!                               XDisplayName(display_name), Scr->vdtPixmap, NULL);
!                       execlp("xloadimage", "xsetbg", "-display",
                                XDisplayName(display_name), Scr->vdtPixmap, NULL);
                        /* Give up, you don't get a background... */


  vdt.c does a rather odd (in my opinion) thing: it first tries to use
xloadimage directly, then tries to use xloadimage as defined by "XLOADIMAGE". I
would prefer to have XLOADIMAGE be whatever command you wish, with
XLOADIMAGE_OPTIONS for the options, then try xloadimage if XLOADIMAGE fails.
That is how this patch works (it also tries xv before xloadimage).

  So, you would define XLOADIMAGE like this:

    XLOADIMAGE = "/the/path/xv"
    XLOADIMAGE_OPTIONS = "-root -quit"

and vdt.c would provide the display and the pixmap. If the program you were
using did not have additional options, XLOADIMAGE_OPTIONS should be "".

> 
> --Rat
> 
> ||||| | | | |  |  |  |   |   |    |    |    |   |   |  |  |  |  | | | | | |||||
>                                                    __        ___ 
> Richard Pieri, Northeastern's Stainless Steel Rat/   | /| / /   | The Worlds
> Internet: ratinox@meceng.coe.northeastern.edu   /__  |/ |/ / /| | Welfare Works
>     UUCP: ...!northeastern.edu!splinter!ratinox/   | /| / / / | | Association:
>   BITNET: UA_RLP@NUHUB{.BITNET}               /__  |/ |/ / /  | | I will solve
>   USNail: 14 Westdale RD  Holbrook, MA 02343 /   | /| / / /___| | any problem
>  ICBMnet: 42 deg 1 min N, 71 deg 0 min W    /    |/ |/ /_//_____| for you.

    Cheers,

    Tom McConnell
-- 
 Tom McConnell          |     Internet: tmcconne@sedona.intel.com
 Intel, Corp. C3-21     |     Phone: (602)-554-8229
 5000 W. Chandler Blvd. | The opinions expressed are my own. No one in 
 Chandler, AZ  85226    | their right mind would claim them.
Xref: sparky comp.windows.x.apps:595 comp.windows.x.motif:5137