* When changing a window's feel, it's now also moved to the front if
necessary. * Also, newly exposed window areas are now refreshed when a change of feel also changed the window order. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17122 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+51
-13
@@ -1749,24 +1749,62 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
|
|||||||
if (!workspace_in_workspaces(i, window->Workspaces()))
|
if (!workspace_in_workspaces(i, window->Workspaces()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
WindowLayer* frontmost = window->Frontmost(_Windows(i).FirstWindow(), i);
|
bool changed = false;
|
||||||
if (frontmost == NULL)
|
BRegion visibleBefore;
|
||||||
continue;
|
if (i == fCurrentWorkspace && window->IsVisible())
|
||||||
|
visibleBefore = window->VisibleRegion();
|
||||||
|
|
||||||
// check if the frontmost window is really in front of it
|
WindowLayer* backmost = window->Backmost(_Windows(i).LastWindow(), i);
|
||||||
|
if (backmost != NULL) {
|
||||||
|
// check if the backmost window is really behind it
|
||||||
|
WindowLayer* previous = window->PreviousWindow(i);
|
||||||
|
while (previous != NULL) {
|
||||||
|
if (previous == backmost)
|
||||||
|
break;
|
||||||
|
|
||||||
WindowLayer* next = window->NextWindow(i);
|
previous = previous->PreviousWindow(i);
|
||||||
while (next != NULL) {
|
}
|
||||||
if (next == frontmost)
|
|
||||||
break;
|
|
||||||
|
|
||||||
next = next->NextWindow(i);
|
if (previous == NULL) {
|
||||||
|
// need to reinsert window before its backmost window
|
||||||
|
_Windows(i).RemoveWindow(window);
|
||||||
|
_Windows(i).AddWindow(window, backmost->NextWindow(i));
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next == NULL) {
|
WindowLayer* frontmost = window->Frontmost(_Windows(i).FirstWindow(), i);
|
||||||
// need to reinsert window behind its frontmost window
|
if (frontmost != NULL) {
|
||||||
_Windows(i).RemoveWindow(window);
|
// check if the frontmost window is really in front of it
|
||||||
_Windows(i).AddWindow(window, frontmost);
|
WindowLayer* next = window->NextWindow(i);
|
||||||
|
while (next != NULL) {
|
||||||
|
if (next == frontmost)
|
||||||
|
break;
|
||||||
|
|
||||||
|
next = next->NextWindow(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (next == NULL) {
|
||||||
|
// need to reinsert window behind its frontmost window
|
||||||
|
_Windows(i).RemoveWindow(window);
|
||||||
|
_Windows(i).AddWindow(window, frontmost);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == fCurrentWorkspace && changed) {
|
||||||
|
BRegion dummy;
|
||||||
|
_RebuildClippingForAllWindows(dummy);
|
||||||
|
|
||||||
|
// mark everything dirty that is no longer visible, or
|
||||||
|
// is now visible and wasn't before
|
||||||
|
BRegion visibleAfter(window->VisibleRegion());
|
||||||
|
BRegion dirty(visibleAfter);
|
||||||
|
dirty.Exclude(&visibleBefore);
|
||||||
|
visibleBefore.Exclude(&visibleAfter);
|
||||||
|
dirty.Include(&visibleBefore);
|
||||||
|
|
||||||
|
MarkDirty(dirty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user