Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!snorkelwacker!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU (der Mouse) Newsgroups: comp.windows.x Subject: Re: save_under & backing_store relations? Message-ID: <9001061202.AA18171@Larry.McRCIM.McGill.EDU> Date: 6 Jan 90 12:02:19 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 48 > From the Red Bible: > "If save-under is True, the X server is advised that, when this > window is mapped, saving the contents of windows it obscures would > be beneficial." > It seems that the good interpretation is: > ... saving the *entire* contents of the windows it obscures ... > [setting all the obscured windows' backing-store flags temporarily ON] > and the bad interpretation was: > ... saving the *partial* contents of the windows it obscures ... > [saving the part of the screen under the save-under window] > My question is: Why? I don't *know*, not being responsible for the decision. However, I would guess that it's simply because doing the latter and getting it right is very difficult. [Terminology: call the window whose save-under hint is set the "menu" window; call the window being temporarily obscured the "obscured" window. I will speak of "the" obscured window even though there may be more than one such. An obscured window for which the server is already maintaining backing-store can of course be ignored.] Suppose the temporarily hidden part of the obscured window is changed while the menu window is up. The saved bits then have to be updated, which is very difficult to get right without maintaining a shadow copy, which is precisely what backing-store does. You're losing because backing-store maintains a shadow copy of more than just the area hidden by the menu window. (Personally, I'd be just as happy to see a much simpler and almost as good version: save the bits as in the "bad" interpretation above, but if an obscured window is changed, clear its portion of the save array to its background color and then generate expose events for that window when the menu window goes away, just as if save-unders weren't being used. Gains the speed advantage in the common case and is correct, even though slower, in the difficult case. And it's not a memory pig in the case that bothered you.) der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu