Removed use of BSession in constructor - conversion to using a BAppServerLink.
BSession streams are not meant for this kind of use git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5600 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -49,6 +49,8 @@
|
|||||||
#include <TokenSpace.h>
|
#include <TokenSpace.h>
|
||||||
#include <MessageUtils.h>
|
#include <MessageUtils.h>
|
||||||
#include <WindowAux.h>
|
#include <WindowAux.h>
|
||||||
|
#include <AppServerLink.h>
|
||||||
|
#include <PortMessage.h>
|
||||||
|
|
||||||
// Standard Includes -----------------------------------------------------------
|
// Standard Includes -----------------------------------------------------------
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -1991,19 +1993,24 @@ void BWindow::InitData( BRect frame,
|
|||||||
if ( !(be_app->IsLocked()) )
|
if ( !(be_app->IsLocked()) )
|
||||||
{ be_app->Lock(); locked = true; }
|
{ be_app->Lock(); locked = true; }
|
||||||
|
|
||||||
session->WriteInt32( AS_CREATE_WINDOW );
|
BPrivate::BAppServerLink *serverlink=new BPrivate::BAppServerLink;
|
||||||
session->WriteRect( fFrame );
|
PortMessage pmsg;
|
||||||
session->WriteInt32( (int32)fLook );
|
|
||||||
session->WriteInt32( (int32)fFeel );
|
serverlink->SetOpCode( AS_CREATE_WINDOW );
|
||||||
session->WriteUInt32( fFlags );
|
serverlink->Attach<BRect>( fFrame );
|
||||||
session->WriteUInt32( workspace );
|
serverlink->Attach<int32>( (int32)fLook );
|
||||||
session->WriteInt32( _get_object_token_(this) );
|
serverlink->Attach<int32>( (int32)fFeel );
|
||||||
session->WriteData( &receive_port, sizeof(port_id) );
|
serverlink->Attach<uint32>( fFlags );
|
||||||
session->WriteData( &fMsgPort, sizeof(port_id) );
|
serverlink->Attach<uint32>( workspace );
|
||||||
session->WriteString( title );
|
serverlink->Attach<int32>( _get_object_token_(this) );
|
||||||
session->Sync();
|
serverlink->Attach( &receive_port, sizeof(port_id) );
|
||||||
|
serverlink->Attach( &fMsgPort, sizeof(port_id) );
|
||||||
|
serverlink->AttachString( title );
|
||||||
|
serverlink->FlushWithReply(&pmsg);
|
||||||
// The port on witch app_server will listen for us
|
// The port on witch app_server will listen for us
|
||||||
session->ReadData( &send_port, sizeof(port_id) );
|
pmsg.Read<port_id>( &send_port );
|
||||||
|
|
||||||
|
delete serverlink;
|
||||||
|
|
||||||
// unlock, so other threads can do their job.
|
// unlock, so other threads can do their job.
|
||||||
if( locked )
|
if( locked )
|
||||||
|
|||||||
Reference in New Issue
Block a user