diff --git a/rainbow/Framebuffer/Ctrl.h b/rainbow/Framebuffer/Ctrl.h index dbf7061ac..ac2f22117 100644 --- a/rainbow/Framebuffer/Ctrl.h +++ b/rainbow/Framebuffer/Ctrl.h @@ -34,6 +34,8 @@ private: static void AddInvalid(const Rect& rect); + void DestroyWnd(); + void NewTop() { top = new Top; top->owner_window = NULL; } void PutForeground(); static void MouseEventFB(Ptr t, int event, Point p, int zdelta); diff --git a/rainbow/Framebuffer/Top.cpp b/rainbow/Framebuffer/Top.cpp index 1eb8ddf62..988950a7c 100644 --- a/rainbow/Framebuffer/Top.cpp +++ b/rainbow/Framebuffer/Top.cpp @@ -14,7 +14,7 @@ void TopWindow::SyncFrameRect(const Rect& r) void TopWindow::DestroyFrame() { if(frame->IsOpen()) - frame->Close(); + frame->DestroyWnd(); } void TopWindow::GripResize() diff --git a/rainbow/Framebuffer/Wnd.cpp b/rainbow/Framebuffer/Wnd.cpp index 04d8a3525..3c93454c1 100644 --- a/rainbow/Framebuffer/Wnd.cpp +++ b/rainbow/Framebuffer/Wnd.cpp @@ -533,7 +533,7 @@ int Ctrl::GetKbdSpeed() return 1000 / 32; } -void Ctrl::WndDestroy0() +void Ctrl::DestroyWnd() { for(int i = 0; i < topctrl.GetCount(); i++) if(topctrl[i]->top && topctrl[i]->top->owner_window == this) @@ -551,8 +551,13 @@ void Ctrl::WndDestroy0() TopWindow *win = dynamic_cast(this); if(win) win->DestroyFrame(); +} + +void Ctrl::WndDestroy0() +{ + DestroyWnd(); if(topctrl.GetCount()) - topctrl.Top()->SetWndForeground0(); + topctrl.Top()->ActivateWnd(); } void Ctrl::PutForeground()