From 2966cc349766a55f2bb9f10bde5eeadef968b1e0 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Thu, 3 Nov 2011 22:16:59 +0000 Subject: [PATCH] Calling Show() in the constructor unlocks the Looper, so calling SetPosition after that doesn't work. Tweak the code around as it doesn't really have to be done there : * Remove the Show() method override * Make sure the window is layouted and moved to the right place before showing it (which is what this early SetPosition call attempted to do) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43173 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../notification/NotificationWindow.cpp | 23 ++++--------------- src/servers/notification/NotificationWindow.h | 2 -- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/servers/notification/NotificationWindow.cpp b/src/servers/notification/NotificationWindow.cpp index 8a280849e9..690ef934a6 100644 --- a/src/servers/notification/NotificationWindow.cpp +++ b/src/servers/notification/NotificationWindow.cpp @@ -190,7 +190,6 @@ NotificationWindow::MessageReceived(BMessage* message) group->AddInfo(view); _ResizeAll(); - SetPosition(); reply.AddInt32("error", B_OK); } else @@ -215,7 +214,6 @@ NotificationWindow::MessageReceived(BMessage* message) fViews.erase(it); _ResizeAll(); - SetPosition(); break; } default: @@ -294,12 +292,6 @@ NotificationWindow::Width() void NotificationWindow::_ResizeAll() { - if (fAppViews.empty()) { - if (!IsHidden()) - Hide(); - return; - } - appview_t::iterator aIt; bool shouldHide = true; @@ -317,9 +309,6 @@ NotificationWindow::_ResizeAll() return; } - if (IsHidden()) - Show(); - for (aIt = fAppViews.begin(); aIt != fAppViews.end(); aIt++) { AppGroupView* view = aIt->second; @@ -331,6 +320,11 @@ NotificationWindow::_ResizeAll() view->Show(); } } + + SetPosition(); + + if (IsHidden()) + Show(); } @@ -467,13 +461,6 @@ NotificationWindow::_SaveAppFilters() } -void NotificationWindow::Show() -{ - BWindow::Show(); - SetPosition(); -} - - void NotificationWindow::_LoadGeneralSettings(bool startMonitor) { diff --git a/src/servers/notification/NotificationWindow.h b/src/servers/notification/NotificationWindow.h index 4556417d7f..41fc457216 100644 --- a/src/servers/notification/NotificationWindow.h +++ b/src/servers/notification/NotificationWindow.h @@ -48,8 +48,6 @@ public: virtual BHandler* ResolveSpecifier(BMessage*, int32, BMessage*, int32, const char*); - void Show(); - icon_size IconSize(); int32 Timeout(); float Width();