From 56a63697ae2471084f4fa7ecc753f2a6582ccef2 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Thu, 16 Apr 2015 21:34:26 +0200 Subject: [PATCH] notification_server: Don't remove the views from the layout. Removing the view from the window and deleting it is fine. This is a quick fix for #11976. The underlaying issue of how BLayout::RemoveView should work still needs to be fixed. --- src/servers/notification/AppGroupView.cpp | 6 +++--- src/servers/notification/NotificationWindow.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/servers/notification/AppGroupView.cpp b/src/servers/notification/AppGroupView.cpp index 0927d16426..38fec7057f 100644 --- a/src/servers/notification/AppGroupView.cpp +++ b/src/servers/notification/AppGroupView.cpp @@ -135,7 +135,7 @@ AppGroupView::MouseDown(BPoint point) if (BRect(fCloseRect).InsetBySelf(-5, -5).Contains(point)) { int32 children = fInfo.size(); for (int32 i = 0; i < children; i++) { - GetLayout()->RemoveView(fInfo[i]); + fInfo[i]->RemoveSelf(); delete fInfo[i]; } @@ -183,7 +183,7 @@ AppGroupView::MessageReceived(BMessage* msg) break; fInfo.erase(vIt); - GetLayout()->RemoveView(view); + view->RemoveSelf(); delete view; fParent->PostMessage(msg); @@ -216,7 +216,7 @@ AppGroupView::AddInfo(NotificationView* view) if (id == fInfo[i]->MessageID()) { NotificationView* oldView = fInfo[i]; fParent->NotificationViewSwapped(oldView, view); - GetLayout()->RemoveView(oldView); + oldView->RemoveSelf(); delete oldView; fInfo[i] = view; diff --git a/src/servers/notification/NotificationWindow.cpp b/src/servers/notification/NotificationWindow.cpp index 07fea0a235..c99070dacd 100644 --- a/src/servers/notification/NotificationWindow.cpp +++ b/src/servers/notification/NotificationWindow.cpp @@ -242,8 +242,8 @@ NotificationWindow::MessageReceived(BMessage* message) if (fAppViews.erase(view->Group()) < 1) break; - if (GetLayout()->RemoveView(view)) - delete view; + view->RemoveSelf(); + delete view; _ShowHide(); break;