Fix SendWindowBehind. It now sets the window layer position behind the specified window. If behindOf is NULL it is send to the bottom. Please review if it really was broken! At least it has not worked as I had expected and what I read from bebook.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38473 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1032,7 +1032,7 @@ Desktop::SendWindowBehind(Window* window, Window* behindOf)
|
|||||||
|
|
||||||
// TODO: should the "not in current workspace" be handled anyway?
|
// TODO: should the "not in current workspace" be handled anyway?
|
||||||
// (the code below would have to be changed then, though)
|
// (the code below would have to be changed then, though)
|
||||||
if (window == BackWindow()
|
if ((behindOf == NULL && window == BackWindow())
|
||||||
|| !window->InWorkspace(fCurrentWorkspace)
|
|| !window->InWorkspace(fCurrentWorkspace)
|
||||||
|| (behindOf != NULL && !behindOf->InWorkspace(fCurrentWorkspace))) {
|
|| (behindOf != NULL && !behindOf->InWorkspace(fCurrentWorkspace))) {
|
||||||
UnlockAllWindows();
|
UnlockAllWindows();
|
||||||
@@ -1047,19 +1047,21 @@ Desktop::SendWindowBehind(Window* window, Window* behindOf)
|
|||||||
// might be dirty after the window is send to back
|
// might be dirty after the window is send to back
|
||||||
BRegion dirty(window->VisibleRegion());
|
BRegion dirty(window->VisibleRegion());
|
||||||
|
|
||||||
// detach window and re-attach at desired position
|
|
||||||
Window* backmost = window->Backmost(behindOf);
|
|
||||||
|
|
||||||
CurrentWindows().RemoveWindow(window);
|
CurrentWindows().RemoveWindow(window);
|
||||||
CurrentWindows().AddWindow(window, backmost
|
CurrentWindows().AddWindow(window, behindOf
|
||||||
? backmost->NextWindow(fCurrentWorkspace) : BackWindow());
|
? behindOf : BackWindow());
|
||||||
|
|
||||||
BRegion dummy;
|
BRegion dummy;
|
||||||
_RebuildClippingForAllWindows(dummy);
|
_RebuildClippingForAllWindows(dummy);
|
||||||
|
|
||||||
// mark everything dirty that is no longer visible
|
// if we send a window to the bottom mark everything dirty that is no
|
||||||
|
// longer visible, if behindOf is not NULL the window may has rose so
|
||||||
|
// include the visible region
|
||||||
BRegion clean(window->VisibleRegion());
|
BRegion clean(window->VisibleRegion());
|
||||||
dirty.Exclude(&clean);
|
if (!behindOf)
|
||||||
|
dirty.Exclude(&clean);
|
||||||
|
else
|
||||||
|
dirty.Include(&clean);
|
||||||
MarkDirty(dirty);
|
MarkDirty(dirty);
|
||||||
|
|
||||||
_UpdateFronts();
|
_UpdateFronts();
|
||||||
|
|||||||
Reference in New Issue
Block a user