[comp.windows.x] Save Under Bit Implementation

ea08+@andrew.cmu.edu (Eric A. Anderson) (11/06/90)

I was wondering if this is being fixed.
When you set the save under bit on a window, the default MIT server
implements this as setting backing store on every window it occludes. 
This has a couple of problems.
First, lets say I'm running tvtwm, and I have a big virtual window.  I
bring up a menu and pop, My server grows to 10Meg.
A similar problem occurs on a monochrome machine although it is 1/8 of
the size.
I noted in the source that it says 'Never set backing store on root window.'
Could something be added with the Backing store variable as 'Never give
me a backing store?'  It seems somehow foolish to save the entire window
when in general menus only occlude a small portion of the screen, and
don't move.  I know for example that the Dec X server does do something
like that, becuase it does not grow like the MIT server does under
tvtwm. (Of course it could just not do save under, but I'd hope not.)
I'm not sure if this is something that is being looked into, but It
might be something that should be fixed.  Something to fix the server so
that it only save the occluded region would be possible, but I'm not
sure how it would be implemented.  On the other hand the 'Never give a
backing store' could work, and would allow windows which really
shouldn't get backing stores, like the tvtwm virtual root, to not get
backing stores.
I hope I haven't rambled too much.
Thanks.
          -Eric
*********************************************************
"My life is full of additional complications spinning around until
 it makes my head snap off."
           -Unc. Known.
"You are very smart, now shut up."
           -In "The Princess Bride"
*********************************************************

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) (11/06/90)

    Something to fix the server so
    that it only save the occluded region would be possible, but I'm not
    sure how it would be implemented.

I implemented this back in March, works great.  No public patches, sorry,
the public will have to wait for R5.  Consortium members have had access
to this code for a while.

keith@EXPO.LCS.MIT.EDU (Keith Packard) (11/07/90)

> First, lets say I'm running tvtwm, and I have a big virtual window.  I
> bring up a menu and pop, My server grows to 10Meg.

Gee, this doesn't happen on *my* server (which creates a pixmap large enough
only for the occluded region)...

>  On the other hand the 'Never give a
> backing store' could work, and would allow windows which really
> shouldn't get backing stores, like the tvtwm virtual root, to not get
> backing stores.

Curiously enough, the way to get this effect is to request backing store on
that window before it is mapped.  This way, the backing store code can keep
track of the fact that nothing is ever rendered to that window and that it
needn't save any information in it other than the background tile.  Any window
with backing store which hasn't been rendered to gets a special optimization
which avoids saving any real bits, instead saving only the background state
when the bits were occluded.  Unfortunately, the backing store code must
assume that any currently mapped window which gets backing store enabled has
useful bits currently displayed on the screen.  You could easily remove this
constraint, at the loss of some level of protocol conformance (if not in word,
than certainly in intent).

clive@x.co.uk (Clive Feather) (11/08/90)

In article <8bBX6we00Vpc89mW1i@andrew.cmu.edu> ea08+@andrew.cmu.edu (Eric A. Anderson) writes:
>When you set the save under bit on a window, the default MIT server
>implements this as setting backing store on every window it occludes. 

>I noted in the source that it says 'Never set backing store on root window.'
>Could something be added with the Backing store variable as 'Never give
>me a backing store?'

If someone is thinking about doing this, can I suggest that any window that
does not have ExposureMask set in its event mask shouldn't need backing store
under *any* circumstances. No client is prepared to repaint the window on
damage, so there is no need for the server to do so either.
-- 
Clive D.W. Feather     | IXI Limited         | If you lie to the compiler,
clive@x.co.uk          | 62-74 Burleigh St.  | it will get its revenge.
Phone: +44 223 462 131 | Cambridge   CB1 1OJ |   - Henry Spencer
(USA: 1 800 XDESK 57)  | United Kingdom      |