* 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:
@@ -1749,12 +1749,33 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
|
|||||||
if (!workspace_in_workspaces(i, window->Workspaces()))
|
if (!workspace_in_workspaces(i, window->Workspaces()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
BRegion visibleBefore;
|
||||||
|
if (i == fCurrentWorkspace && window->IsVisible())
|
||||||
|
visibleBefore = window->VisibleRegion();
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
previous = previous->PreviousWindow(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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WindowLayer* frontmost = window->Frontmost(_Windows(i).FirstWindow(), i);
|
WindowLayer* frontmost = window->Frontmost(_Windows(i).FirstWindow(), i);
|
||||||
if (frontmost == NULL)
|
if (frontmost != NULL) {
|
||||||
continue;
|
|
||||||
|
|
||||||
// check if the frontmost window is really in front of it
|
// check if the frontmost window is really in front of it
|
||||||
|
|
||||||
WindowLayer* next = window->NextWindow(i);
|
WindowLayer* next = window->NextWindow(i);
|
||||||
while (next != NULL) {
|
while (next != NULL) {
|
||||||
if (next == frontmost)
|
if (next == frontmost)
|
||||||
@@ -1767,6 +1788,23 @@ Desktop::SetWindowFeel(WindowLayer *window, window_feel newFeel)
|
|||||||
// need to reinsert window behind its frontmost window
|
// need to reinsert window behind its frontmost window
|
||||||
_Windows(i).RemoveWindow(window);
|
_Windows(i).RemoveWindow(window);
|
||||||
_Windows(i).AddWindow(window, frontmost);
|
_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