[haiku-commits] Re: r38473 - haiku/trunk/src/servers/app

clemens.zeidler@xxxxxxxxxxxxxx wrote:
> Fix SendWindowBehind. It now sets the window layer position behind 
> the
> specified window. If behindOf is NULL it is send to the bottom. 

I actually don't think it was - all that SendWindowBehind() does if 
behindOf is set, is to make sure it's behind that window, ie. not in 
front of it. It does not mean it should be directly behind that window. 
That's also something the app_server couldn't guarantee by any means, 
anyway (see below).

> @@ -1047,19 +1047,21 @@
>       // might be dirty after the window is send to back
>       BRegion dirty(window->VisibleRegion());
>  
> -     // detach window and re-attach at desired position
> -     Window* backmost = window->Backmost(behindOf);
> -
>       CurrentWindows().RemoveWindow(window);
> -     CurrentWindows().AddWindow(window, backmost
> -             ? backmost->NextWindow(fCurrentWorkspace) : BackWindow());
> +     CurrentWindows().AddWindow(window, behindOf
> +             ? behindOf : BackWindow());

This breaks a lot of concepts in the app_server; you can't just let the 
user decide where the window should appear - you have to make sure 
certain constraints are met with respect to subset windows. That's what 
Window::Backmost() takes care of. You must not remove that. 
Furthermore, the existence of "behindOf" does not mean that the window 
actually roses even after your changes - in this case, you would now 
repaint much more than needed.
IOW please revert again.

Bye,
   Axel.


Other related posts: