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
This commit is contained in:
Adrien Destugues 2011-11-03 22:16:59 +00:00
parent dd9eb3ad8b
commit 2966cc3497
2 changed files with 5 additions and 20 deletions

View File

@ -190,7 +190,6 @@ NotificationWindow::MessageReceived(BMessage* message)
group->AddInfo(view); group->AddInfo(view);
_ResizeAll(); _ResizeAll();
SetPosition();
reply.AddInt32("error", B_OK); reply.AddInt32("error", B_OK);
} else } else
@ -215,7 +214,6 @@ NotificationWindow::MessageReceived(BMessage* message)
fViews.erase(it); fViews.erase(it);
_ResizeAll(); _ResizeAll();
SetPosition();
break; break;
} }
default: default:
@ -294,12 +292,6 @@ NotificationWindow::Width()
void void
NotificationWindow::_ResizeAll() NotificationWindow::_ResizeAll()
{ {
if (fAppViews.empty()) {
if (!IsHidden())
Hide();
return;
}
appview_t::iterator aIt; appview_t::iterator aIt;
bool shouldHide = true; bool shouldHide = true;
@ -317,9 +309,6 @@ NotificationWindow::_ResizeAll()
return; return;
} }
if (IsHidden())
Show();
for (aIt = fAppViews.begin(); aIt != fAppViews.end(); aIt++) { for (aIt = fAppViews.begin(); aIt != fAppViews.end(); aIt++) {
AppGroupView* view = aIt->second; AppGroupView* view = aIt->second;
@ -331,6 +320,11 @@ NotificationWindow::_ResizeAll()
view->Show(); view->Show();
} }
} }
SetPosition();
if (IsHidden())
Show();
} }
@ -467,13 +461,6 @@ NotificationWindow::_SaveAppFilters()
} }
void NotificationWindow::Show()
{
BWindow::Show();
SetPosition();
}
void void
NotificationWindow::_LoadGeneralSettings(bool startMonitor) NotificationWindow::_LoadGeneralSettings(bool startMonitor)
{ {

View File

@ -48,8 +48,6 @@ public:
virtual BHandler* ResolveSpecifier(BMessage*, int32, BMessage*, virtual BHandler* ResolveSpecifier(BMessage*, int32, BMessage*,
int32, const char*); int32, const char*);
void Show();
icon_size IconSize(); icon_size IconSize();
int32 Timeout(); int32 Timeout();
float Width(); float Width();