InitData() no longer calls SetTitle(), but sets the title directly.

SetTitle() now also works when called before the window is shown for the first time
(ie. before the window thread is running).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14852 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-11-11 13:09:23 +00:00
parent dfd5b49996
commit 9032e7128e
1 changed files with 12 additions and 14 deletions

View File

@ -1411,16 +1411,15 @@ BWindow::SetTitle(const char *title)
SetName(threadName);
// if the message loop has been started...
if (Thread() >= B_OK) {
if (Thread() >= B_OK)
rename_thread(Thread(), threadName);
// we notify the app_server so we can actually see the change
if (Lock()) {
fLink->StartMessage(AS_SET_WINDOW_TITLE);
fLink->AttachString(fTitle);
fLink->Flush();
Unlock();
}
// we notify the app_server so we can actually see the change
if (Lock()) {
fLink->StartMessage(AS_SET_WINDOW_TITLE);
fLink->AttachString(fTitle);
fLink->Flush();
Unlock();
}
}
@ -1928,8 +1927,7 @@ BWindow::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
}
// #pragma mark -
//--------------------Private Methods-------------------------------------------
// #pragma mark - Private Methods
void
@ -1938,8 +1936,6 @@ BWindow::InitData(BRect frame, const char* title, window_look look,
{
STRACE(("BWindow::InitData()\n"));
fTitle = NULL;
if (be_app == NULL) {
debugger("You need a valid BApplication object before interacting with the app_server");
return;
@ -1947,8 +1943,10 @@ BWindow::InitData(BRect frame, const char* title, window_look look,
fFrame = frame;
// ToDo: that looks wrong...
SetTitle(title ? title : "no_name_window");
if (title == NULL)
title = "";
fTitle = strdup(title);
SetName(title);
fFeel = feel;
fLook = look;