From 41c719936be8ae1e204f25e49c35684f2cf714b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 1 Jul 2005 18:26:18 +0000 Subject: [PATCH] Fixed SetLook() (is not implemented server-side, though). Finally got the thread rename code right under R5 8-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13391 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 6aa23ec97e..c6290a2fe7 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -1448,7 +1449,7 @@ BWindow::SetTitle(const char *title) int32 length = strlen(title); length = min_c(length, B_OS_NAME_LENGTH - 3); memcpy(threadName + 2, title, length); - threadName[length] = '\0'; + threadName[length + 2] = '\0'; #endif SetName(threadName); @@ -1586,18 +1587,16 @@ BWindow::Type() const status_t BWindow::SetLook(window_look look) { + BAutolock locker(this); - Lock(); fLink->StartMessage(AS_SET_LOOK); fLink->Attach((int32)look); - int32 code = SERVER_FALSE; - fLink->FlushWithReply(code); - - Unlock(); + int32 code; + status_t status = fLink->FlushWithReply(code); // ToDo: the server should probably return something more meaningful, anyway - if (code == SERVER_TRUE) { + if (status == B_OK && code == SERVER_TRUE) { fLook = look; return B_OK; }