Removed a couple of unnecessary includes
(Hopefully) patched a crash under the BApplication Quit2 test Speedup for CursorManager::RemoveAppCursors git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9216 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -153,23 +153,18 @@ void CursorManager::DeleteCursor(int32 token)
|
|||||||
\brief Removes and deletes all of an application's cursors
|
\brief Removes and deletes all of an application's cursors
|
||||||
\param signature Signature to which the cursors belong
|
\param signature Signature to which the cursors belong
|
||||||
*/
|
*/
|
||||||
void CursorManager::RemoveAppCursors(const char *signature)
|
void CursorManager::RemoveAppCursors(team_id team)
|
||||||
{
|
{
|
||||||
// OPTIMIZATION: For an optimization, it perhaps may be wise down
|
|
||||||
// the road to replace the ServerCursor's app signature with a
|
|
||||||
// pointer to its application and compare ServerApp pointers instead.
|
|
||||||
Lock();
|
Lock();
|
||||||
|
|
||||||
ServerCursor *temp;
|
ServerCursor *temp;
|
||||||
for(int32 i=0; i<fCursorList->CountItems();i++)
|
for(int32 i=0; i<fCursorList->CountItems();i++)
|
||||||
{
|
{
|
||||||
temp=(ServerCursor*)fCursorList->ItemAt(i);
|
temp=(ServerCursor*)fCursorList->ItemAt(i);
|
||||||
if(temp && temp->GetAppSignature() &&
|
if(temp && temp->OwningTeam()==team)
|
||||||
strcmp(signature, temp->GetAppSignature())==0)
|
|
||||||
{
|
{
|
||||||
fCursorList->RemoveItem(i);
|
fCursorList->RemoveItem(i);
|
||||||
delete temp;
|
delete temp;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Unlock();
|
Unlock();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
~CursorManager(void);
|
~CursorManager(void);
|
||||||
int32 AddCursor(ServerCursor *sc);
|
int32 AddCursor(ServerCursor *sc);
|
||||||
void DeleteCursor(int32 token);
|
void DeleteCursor(int32 token);
|
||||||
void RemoveAppCursors(const char *signature);
|
void RemoveAppCursors(team_id team);
|
||||||
void ShowCursor(void);
|
void ShowCursor(void);
|
||||||
void HideCursor(void);
|
void HideCursor(void);
|
||||||
void ObscureCursor(void);
|
void ObscureCursor(void);
|
||||||
|
|||||||
@@ -98,10 +98,18 @@ ServerApp::ServerApp(port_id sendport, port_id rcvport, port_id clientLooperPort
|
|||||||
fBitmapList=new BList(0);
|
fBitmapList=new BList(0);
|
||||||
fPictureList=new BList(0);
|
fPictureList=new BList(0);
|
||||||
fIsActive=false;
|
fIsActive=false;
|
||||||
|
|
||||||
|
char *dummy;
|
||||||
|
fSharedMem=create_area("rw_shared_area",(void**)&dummy,B_ANY_ADDRESS,4096,B_NO_LOCK,
|
||||||
|
B_READ_AREA|B_WRITE_AREA);
|
||||||
|
|
||||||
|
if(fSharedMem<0)
|
||||||
|
printf("PANIC: Couldn't create shared app_server area!\n");
|
||||||
|
|
||||||
ServerCursor *defaultc=cursormanager->GetCursor(B_CURSOR_DEFAULT);
|
ServerCursor *defaultc=cursormanager->GetCursor(B_CURSOR_DEFAULT);
|
||||||
|
|
||||||
fAppCursor=(defaultc)?new ServerCursor(defaultc):NULL;
|
fAppCursor=(defaultc)?new ServerCursor(defaultc):NULL;
|
||||||
|
fAppCursor->SetOwningTeam(fClientTeamID);
|
||||||
fLockSem=create_sem(1,"ServerApp sem");
|
fLockSem=create_sem(1,"ServerApp sem");
|
||||||
|
|
||||||
// Does this even belong here any more? --DW
|
// Does this even belong here any more? --DW
|
||||||
@@ -148,7 +156,7 @@ ServerApp::~ServerApp(void)
|
|||||||
delete fAppCursor;
|
delete fAppCursor;
|
||||||
|
|
||||||
|
|
||||||
cursormanager->RemoveAppCursors(fSignature.String());
|
cursormanager->RemoveAppCursors(fClientTeamID);
|
||||||
delete_sem(fLockSem);
|
delete_sem(fLockSem);
|
||||||
|
|
||||||
STRACE(("#ServerApp %s:~ServerApp()\n",fSignature.String()));
|
STRACE(("#ServerApp %s:~ServerApp()\n",fSignature.String()));
|
||||||
@@ -157,6 +165,7 @@ ServerApp::~ServerApp(void)
|
|||||||
thread_info info;
|
thread_info info;
|
||||||
if(get_thread_info(fMonitorThreadID,&info)==B_OK)
|
if(get_thread_info(fMonitorThreadID,&info)==B_OK)
|
||||||
kill_thread(fMonitorThreadID);
|
kill_thread(fMonitorThreadID);
|
||||||
|
delete_area(fSharedMem);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -367,7 +376,7 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg)
|
|||||||
}
|
}
|
||||||
case AS_UPDATE_COLORS:
|
case AS_UPDATE_COLORS:
|
||||||
{
|
{
|
||||||
// Eventually we will have windows which will notify their children of changes in
|
// NOTE: R2: Eventually we will have windows which will notify their children of changes in
|
||||||
// system colors
|
// system colors
|
||||||
|
|
||||||
/* STRACE(("ServerApp %s: Received global UI color update notification\n",fSignature.String()));
|
/* STRACE(("ServerApp %s: Received global UI color update notification\n",fSignature.String()));
|
||||||
@@ -386,7 +395,7 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg)
|
|||||||
}
|
}
|
||||||
case AS_UPDATE_FONTS:
|
case AS_UPDATE_FONTS:
|
||||||
{
|
{
|
||||||
// Eventually we will have windows which will notify their children of changes in
|
// NOTE: R2: Eventually we will have windows which will notify their children of changes in
|
||||||
// system fonts
|
// system fonts
|
||||||
|
|
||||||
/* STRACE(("ServerApp %s: Received global font update notification\n",fSignature.String()));
|
/* STRACE(("ServerApp %s: Received global font update notification\n",fSignature.String()));
|
||||||
@@ -403,6 +412,20 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg)
|
|||||||
}
|
}
|
||||||
*/ break;
|
*/ break;
|
||||||
}
|
}
|
||||||
|
case AS_ACQUIRE_SERVERMEM:
|
||||||
|
{
|
||||||
|
// Received from a ServerMemIO object requesting operating memory
|
||||||
|
// Attached Data:
|
||||||
|
// 1) size_t requested size
|
||||||
|
|
||||||
|
// TODO: Implement AS_ACQUIRE_SERVERMEM
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case AS_RELEASE_SERVERMEM:
|
||||||
|
{
|
||||||
|
// TODO: Implement AS_RELEASE_SERVERMEM
|
||||||
|
break;
|
||||||
|
}
|
||||||
case AS_UPDATE_DECORATOR:
|
case AS_UPDATE_DECORATOR:
|
||||||
{
|
{
|
||||||
STRACE(("ServerApp %s: Received decorator update notification\n",fSignature.String()));
|
STRACE(("ServerApp %s: Received decorator update notification\n",fSignature.String()));
|
||||||
@@ -683,6 +706,7 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg)
|
|||||||
cursormanager->DeleteCursor(fAppCursor->ID());
|
cursormanager->DeleteCursor(fAppCursor->ID());
|
||||||
|
|
||||||
fAppCursor=new ServerCursor(cdata);
|
fAppCursor=new ServerCursor(cdata);
|
||||||
|
fAppCursor->SetOwningTeam(fClientTeamID);
|
||||||
fAppCursor->SetAppSignature(fSignature.String());
|
fAppCursor->SetAppSignature(fSignature.String());
|
||||||
cursormanager->AddCursor(fAppCursor);
|
cursormanager->AddCursor(fAppCursor);
|
||||||
cursormanager->SetCursor(fAppCursor->ID());
|
cursormanager->SetCursor(fAppCursor->ID());
|
||||||
@@ -730,6 +754,7 @@ void ServerApp::_DispatchMessage(int32 code, BPortLink& msg)
|
|||||||
msg.Read<int32>(&replyport);
|
msg.Read<int32>(&replyport);
|
||||||
|
|
||||||
fAppCursor=new ServerCursor(cdata);
|
fAppCursor=new ServerCursor(cdata);
|
||||||
|
fAppCursor->SetOwningTeam(fClientTeamID);
|
||||||
fAppCursor->SetAppSignature(fSignature.String());
|
fAppCursor->SetAppSignature(fSignature.String());
|
||||||
cursormanager->AddCursor(fAppCursor);
|
cursormanager->AddCursor(fAppCursor);
|
||||||
|
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ protected:
|
|||||||
bool fCursorHidden;
|
bool fCursorHidden;
|
||||||
bool fIsActive;
|
bool fIsActive;
|
||||||
int32 fHandlerToken;
|
int32 fHandlerToken;
|
||||||
|
area_id fSharedMem;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ ServerCursor::ServerCursor(BRect r, color_space cspace, int32 flags, BPoint hots
|
|||||||
{
|
{
|
||||||
fHotSpot=hotspot;
|
fHotSpot=hotspot;
|
||||||
fHotSpot.ConstrainTo(Bounds());
|
fHotSpot.ConstrainTo(Bounds());
|
||||||
|
fOwningTeam=-1;
|
||||||
|
|
||||||
_AllocateBuffer();
|
_AllocateBuffer();
|
||||||
}
|
}
|
||||||
@@ -59,6 +60,7 @@ ServerCursor::ServerCursor(int8 *data)
|
|||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
fInitialized=true;
|
fInitialized=true;
|
||||||
|
fOwningTeam=-1;
|
||||||
uint32 black=0xFF000000,
|
uint32 black=0xFF000000,
|
||||||
white=0xFFFFFFFF,
|
white=0xFFFFFFFF,
|
||||||
*bmppos;
|
*bmppos;
|
||||||
@@ -113,6 +115,7 @@ ServerCursor::ServerCursor(const ServerCursor *cursor)
|
|||||||
{
|
{
|
||||||
_AllocateBuffer();
|
_AllocateBuffer();
|
||||||
fInitialized=true;
|
fInitialized=true;
|
||||||
|
fOwningTeam=-1;
|
||||||
|
|
||||||
if(cursor)
|
if(cursor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <GraphicsDefs.h>
|
#include <GraphicsDefs.h>
|
||||||
#include <PortLink.h>
|
#include <PortLink.h>
|
||||||
#include <Session.h>
|
|
||||||
#include "Desktop.h"
|
#include "Desktop.h"
|
||||||
#include "AppServer.h"
|
#include "AppServer.h"
|
||||||
#include "Layer.h"
|
#include "Layer.h"
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
#include <Debug.h>
|
#include <Debug.h>
|
||||||
#include <TokenSpace.h>
|
|
||||||
#include "PortLink.h"
|
#include "PortLink.h"
|
||||||
#include "View.h" // for mouse button defines
|
#include "View.h" // for mouse button defines
|
||||||
#include "ServerWindow.h"
|
#include "ServerWindow.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user