That would be a bug indeed.
* ShowWindow() and HideWindow() now also work correctly for windows not on the current workspace. * Reverted WindowList::RemoveWindow() - if it is used wrongly, it should better crash the server for now, so that we can iron out the bugs. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15420 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -931,8 +931,15 @@ Desktop::ShowWindow(WindowLayer* window)
|
||||
WriteLockWindows();
|
||||
|
||||
window->SetHidden(false);
|
||||
_ShowWindow(window, true);
|
||||
ActivateWindow(window);
|
||||
|
||||
if (window->OnWorkspace(fCurrentWorkspace)) {
|
||||
_ShowWindow(window, true);
|
||||
ActivateWindow(window);
|
||||
} else {
|
||||
// then we don't need to send the fake mouse event either
|
||||
WriteUnlockWindows();
|
||||
return;
|
||||
}
|
||||
|
||||
WriteUnlockWindows();
|
||||
|
||||
@@ -971,11 +978,13 @@ Desktop::HideWindow(WindowLayer* window)
|
||||
|
||||
window->SetHidden(true);
|
||||
|
||||
_HideWindow(window);
|
||||
_UpdateFronts();
|
||||
if (window->OnWorkspace(fCurrentWorkspace)) {
|
||||
_HideWindow(window);
|
||||
_UpdateFronts();
|
||||
|
||||
if (FocusWindow() == window)
|
||||
SetFocusWindow(FrontWindow());
|
||||
if (FocusWindow() == window)
|
||||
SetFocusWindow(FrontWindow());
|
||||
}
|
||||
|
||||
WriteUnlockWindows();
|
||||
}
|
||||
|
||||
@@ -82,28 +82,22 @@ WindowList::AddWindow(WindowLayer* window, WindowLayer* before)
|
||||
void
|
||||
WindowList::RemoveWindow(WindowLayer* window)
|
||||
{
|
||||
// TODO: Axel, the same window can be removed in the same list
|
||||
// more than once, would that be a bug?
|
||||
window_anchor& windowAnchor = window->Anchor(fIndex);
|
||||
|
||||
if (fFirstWindow == window) {
|
||||
// it's the first child
|
||||
fFirstWindow = windowAnchor.next;
|
||||
} else {
|
||||
// it must have a previous sibling if it was not
|
||||
// previously removed from this list
|
||||
if (windowAnchor.previous)
|
||||
windowAnchor.previous->Anchor(fIndex).next = windowAnchor.next;
|
||||
// it must have a previous sibling, then
|
||||
windowAnchor.previous->Anchor(fIndex).next = windowAnchor.next;
|
||||
}
|
||||
|
||||
if (fLastWindow == window) {
|
||||
// it's the last child
|
||||
fLastWindow = windowAnchor.previous;
|
||||
} else {
|
||||
// it must have a next sibling if it was not
|
||||
// previously removed from this list
|
||||
if (windowAnchor.next)
|
||||
windowAnchor.next->Anchor(fIndex).previous = windowAnchor.previous;
|
||||
// then it must have a next sibling
|
||||
windowAnchor.next->Anchor(fIndex).previous = windowAnchor.previous;
|
||||
}
|
||||
|
||||
windowAnchor.previous = NULL;
|
||||
|
||||
Reference in New Issue
Block a user