Subject: RE: FVWM Stacking Order Patch (was: no subject)

From: Bob Woodside <[email-masked]>
Date: Sat, 16 May 1998 02:30:30 -0400 (EDT)

I'd like to propose an alternative to Austin Donnelly's solution
to the (more or less) reversed stacking order on Restart problem, which
eliminates the added overhead.

        I've uploaded the StackingOrder patch to incoming and notified
Jason. It should appear in the unofficial_patches directory soon. It does
three things.

        First, it adds a second set of chain pointers to the FvwmWindow
structure, which keeps track of the current stacking order. (Don't hit
me, please. It's really not as bad as it sounds!) So now Fvwm can easily
answer the question "who's on third?" at any time without doing a
Vaudeville routine with the server.

        Second, using this new-found knowledge, the Restart stacking
order problem is solved by a one-line change of the Reborder loop control
to something like

  for (t = Scr.FvwmRoot.stack_prev; t != &Scr.FvwmRoot; t = t->stack_prev)

        Third, it restructures the changeDesk and MoveViewport logic to
perform a simultaneous bidirectional loop through the window list via the
new stacking order chain. Windows that are moving off the visible screen
are unmapped/moved from the bottom of the stacking order upwards, to
minimize expose/redraw overhead. Windows that are moving onto the visible
screen are mapped/moved from the top down, for the same reason.

        A nice (I think) side effect of this, is that the visual dis-
turbance is not only minimized, but somewhat equalized. Previously,
moving off a page with a lot of overlapped windows was slow and entailed
a lot of needless redrawing activity, whereas moving onto such a page
was smooth and quick. This change evens out that inequity quite a bit.

        The third part was suggested to me a few weeks ago by a post from
Jan Vicherek, who mentioned that the flashing and the slowness of moving
off a page containing a lot of overlapped windows could be very annoying.
While I'm not going to try this with 30 - 90 windows on one page, I see
a very noticeable improvement in speed and smoothness on my system with
even a few overlapped windows. The added overhead of the dual loop seems
to be more than offset by reduced demands on the server.

        I would expect, on average, to see at least a marginal improvement
in most page/desk transitions. Of course, if you *never* have any 
overlapping  windows, you're not likely to notice any great improvement. 

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Bob Woodside <[email-masked]>
Date: Wed, 20 May 1998 20:35:07 -0400 (EDT)

I've had couple of reports of dramatic performance improvement
with the Stacking Order patch I submitted over the weekend. It seems to
have turned out far better than I'd expected when I started working on
it.

        Of course, all hell broke loose immediately afterwards, so I
was a little surprised that anyone noticed it - particulary with that
catchy subject line!  :-)

        I'll do my best to get it reworked for the new code base as
soon as Brady makes it available.