* extend Haiku specific client window info to include the tab height and border size

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29064 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Karsten Heimrich 2009-01-27 21:03:32 +00:00
parent a4797804ba
commit 320a952cdd
2 changed files with 21 additions and 1 deletions

View File

@ -34,6 +34,8 @@ struct window_info {
} _PACKED;
struct client_window_info : window_info {
float tab_height;
float border_size;
char name[1];
} _PACKED;

View File

@ -2614,15 +2614,33 @@ Desktop::WriteWindowInfo(int32 serverToken, BPrivate::LinkSender& sender)
window_info info;
window->GetInfo(info);
float tabSize = 0.0;
float borderSize = 0.0;
::Window* tmp = window->Window();
if (tmp) {
BMessage message;
if (tmp->GetDecoratorSettings(&message)) {
BRect tabFrame;
message.FindRect("tab frame", &tabFrame);
tabSize = tabFrame.bottom - tabFrame.top;
message.FindFloat("border width", &borderSize);
}
}
int32 decoratorInfo = 2 * sizeof(float);
int32 length = window->Title() ? strlen(window->Title()) : 0;
sender.StartMessage(B_OK);
sender.Attach<int32>(sizeof(window_info) + length + 1);
sender.Attach<int32>(sizeof(window_info) + decoratorInfo + length + 1);
sender.Attach(&info, sizeof(window_info));
sender.Attach<float>(tabSize);
sender.Attach<float>(borderSize);
if (length > 0)
sender.Attach(window->Title(), length + 1);
else
sender.Attach<char>('\0');
sender.Flush();
}