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();
|
WriteLockWindows();
|
||||||
|
|
||||||
window->SetHidden(false);
|
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();
|
WriteUnlockWindows();
|
||||||
|
|
||||||
@@ -971,11 +978,13 @@ Desktop::HideWindow(WindowLayer* window)
|
|||||||
|
|
||||||
window->SetHidden(true);
|
window->SetHidden(true);
|
||||||
|
|
||||||
_HideWindow(window);
|
if (window->OnWorkspace(fCurrentWorkspace)) {
|
||||||
_UpdateFronts();
|
_HideWindow(window);
|
||||||
|
_UpdateFronts();
|
||||||
|
|
||||||
if (FocusWindow() == window)
|
if (FocusWindow() == window)
|
||||||
SetFocusWindow(FrontWindow());
|
SetFocusWindow(FrontWindow());
|
||||||
|
}
|
||||||
|
|
||||||
WriteUnlockWindows();
|
WriteUnlockWindows();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,28 +82,22 @@ WindowList::AddWindow(WindowLayer* window, WindowLayer* before)
|
|||||||
void
|
void
|
||||||
WindowList::RemoveWindow(WindowLayer* window)
|
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);
|
window_anchor& windowAnchor = window->Anchor(fIndex);
|
||||||
|
|
||||||
if (fFirstWindow == window) {
|
if (fFirstWindow == window) {
|
||||||
// it's the first child
|
// it's the first child
|
||||||
fFirstWindow = windowAnchor.next;
|
fFirstWindow = windowAnchor.next;
|
||||||
} else {
|
} else {
|
||||||
// it must have a previous sibling if it was not
|
// it must have a previous sibling, then
|
||||||
// previously removed from this list
|
windowAnchor.previous->Anchor(fIndex).next = windowAnchor.next;
|
||||||
if (windowAnchor.previous)
|
|
||||||
windowAnchor.previous->Anchor(fIndex).next = windowAnchor.next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fLastWindow == window) {
|
if (fLastWindow == window) {
|
||||||
// it's the last child
|
// it's the last child
|
||||||
fLastWindow = windowAnchor.previous;
|
fLastWindow = windowAnchor.previous;
|
||||||
} else {
|
} else {
|
||||||
// it must have a next sibling if it was not
|
// then it must have a next sibling
|
||||||
// previously removed from this list
|
windowAnchor.next->Anchor(fIndex).previous = windowAnchor.previous;
|
||||||
if (windowAnchor.next)
|
|
||||||
windowAnchor.next->Anchor(fIndex).previous = windowAnchor.previous;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
windowAnchor.previous = NULL;
|
windowAnchor.previous = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user