Re: Pager background patch2

sashav (sashav@sprintmail.com)
Thu, 20 Aug 1998 07:50:53 -0500


David Mihm wrote:
> On Wed, 19 Aug 1998, sashav wrote:
> ! Ethan wrote:
> ! > On Sun, 16 Aug 1998, sashav wrote:
> ! > > backgr2fast in addition feature new technique in showing non-XPM
> ! > > files as background. It runs external application to show
> ! > > background first time, then, when you change desktop it grabs
> ! > > background image from desktop and uses it afterwards, when you switch
> ! > > back, instead of running external application again.
> ! >
> ! > Hmm, the background grabbing is not a good feature on my system.  It eats
> ! > 932k of memory when the backing pixmap is allocated.  That's more than
> ! > the AfterStep process uses!  It is much faster, but the memory overhead
> ! > is too high, IMO.
> ! > Ethan Fischer
> ! Enclosed is the new patch that has this feature turned off by default.
> ! If somebody wants to turn it on, he needs to add line to pager config,
> ! like this :
> ! *PagerFastBackground  0    yes  [tile_hsize [tile_vsize]]
> ! for every desktop he needs this feature on.
> ! tile_hsize & tile_vsize - defines region on the screen that will be
> ! Sasha
> 
>         I tried this[1] on pre7p14 and pre9; something is terribly wrong
> here!  If one switches between desks rapidly - *100%* of *both* swap and
> RAM become used and the machine is put in a unusable state (I have
> had to manually reset box)!

O-o. Evidently It's getting fork()-ed everytime you switch desktop and
runs many copies of xli
at the same time.
I think I know how to fix it.


> 
> Screen example:
>         http://www.the-site.dyn.ml.org/AfterStep98.gif

VErrry nice. That is a big monitor you have !!!!

> Settings: (P200 w/96MB RAM 128MB swap)
>         *PagerXPM       desk#   <pixmap-path>/small.xpm
>         *PagerWallPaper desk#   ~/G/L/A/n/desk#_background
>                 [where background is a 300x200 +/- jpeg image to be
>                 stretched to fill screen (#define XIMAGELOADER
>                 "xli -fillscreen -onroot -quiet")]
>         *PagerFastBackground  desk#  no

You see it was just using xli every time you switch desktops.

>         small.xpm    == 33959-46535 k range (a section of the #_background
>                                              that the pager is on top of)
>         #_background == 163571 k (same for each desktop)
> 
> [1] backgr2+fast_1.5.7_clean.patch , smooth patch to pre7p14; smooth
> patch on src/afpager/* and hand patched on src/afterstep/* to pre9.  No
> .rej's .

I've got the 1.5pre9 and next patch will be for it
 
>         Similar issue:
> 1) With all the above settings and *PagerFastBackground now set to yes;
> the jpeg images are never drawn back onto the desktop.

Hmm.

> 
> 2) Setting the actual <hsize> <vsize> (on mine == 1600 1200) fixes the
> issue of "1)" above; the jpegs are redrawn in the desktop.  Memory
> use seems to remain constant with rapid changes between desktops. Although
> overall memory use has obviously grown several times. :\

Well, definately it's going to be 1600x1200x4xDesksNum bytes at least.

> 
> Suggestion:
> 
>         I and many others use the same image for each desk, I would think
> some sort of checking should be done to see if this is the case, and not
> allocate a different memory block for each screen since they would all be
> the same.  Does that make sense?

It does. I'll se what I can do.

>         I'm not sure if the expanded patch.readme from you about setting
> the  XIMAGELOADER was in response to my mail concerning a
> "*PagerAppOptions -opt -to -xv|xli|display"; but possibly you
> misunderstood my reasoning, I shall try to clarify here:

nope. It was in respoce to posting on AS BBS where man asked how he can
change
default image application.

> 
>         If one day I want to tile a small xpm for my desktop, a setting of
> #define XIMAGELOADER "xli -onroot -quiet -colors 20" would work great,
> without problem.  But say the next day I want to use one jpeg image that
> is *not* tiled, but is centered on the desktop with a border of black; I
> would have to recompile the Pager and change the XIMAGELOADER to #define
> XIMAGELOADER "xli -border black -center -onroot -quiet -colors 20".  Now
> the third day I want to use a high resolution 300x225 jpeg image and
> stretch it to fit my entire desktop.  I again would have to recompile the
> Pager and use #define XIMAGELOADER "xli -fillscreen -onroot -quiet".  As
> you can see I would have to have a different Pager binary for all the
> types of options I might one day wish to use.  I believe an XIMAGELOADER
> should just be that - the application you wish to be the X image loader,
> without all the options; therefore, making use af something like
> "*PagerAppOptions -fillscreen -onroot -quiet".  Here I would only

That is a good one. I'm definately for it. We can eve put the whole
thing in there,
like :

*PagerAppOptions xli -fillscreen -onroot -quiet

> have to edit the pager file instead of keeping a hundred or so Pager
> entires on my disk and in the Modules menu.  I hope this makes more sense.
> And I'm not suggesting that this needs to be put in ASAP, as the 1.5pre is
> a code freeze, but it's something to think about for the next pre-release.

Sure. 
I would suggest putting backgr2slow patch in 1.5 as far as you cannot
say that Pager
as it is is the stable app. One cannot call app stable if it can write
stuff in NULL
address and the crush on you. And that is the case.
Or disable the whole feature of non-XPM backgrounds for now.

>         Thanks for the patches, and all you efforts.

Sasha.