* small cleanups

* reworded Activate and commented out all code
  that actually tries to change the cusor shape


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15917 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2006-01-11 22:27:51 +00:00
parent d72cb8f8d7
commit b073091ab3
+21 -9
View File
@@ -186,8 +186,9 @@ ServerApp::~ServerApp()
gBitmapManager->DeleteBitmap(static_cast<ServerBitmap *>(fBitmapList.ItemAt(i))); gBitmapManager->DeleteBitmap(static_cast<ServerBitmap *>(fBitmapList.ItemAt(i)));
} }
for (int32 i = 0; i < fPictureList.CountItems(); i++) { int32 pictureCount = fPictureList.CountItems();
delete (ServerPicture*)fPictureList.ItemAt(i); for (int32 i = 0; i < pictureCount; i++) {
delete (ServerPicture*)fPictureList.ItemAtFast(i);
} }
fDesktop->GetCursorManager().RemoveAppCursors(fClientTeam); fDesktop->GetCursorManager().RemoveAppCursors(fClientTeam);
@@ -281,8 +282,16 @@ ServerApp::SendMessageToClient(BMessage *msg) const
void void
ServerApp::Activate(bool value) ServerApp::Activate(bool value)
{ {
if (fIsActive == value)
return;
// TODO: send some message to the client?!?
fIsActive = value; fIsActive = value;
SetAppCursor();
if (fIsActive) {
SetAppCursor();
}
} }
@@ -290,8 +299,10 @@ ServerApp::Activate(bool value)
void void
ServerApp::SetAppCursor() ServerApp::SetAppCursor()
{ {
if (fAppCursor) // TODO: look into custom cursors...
fDesktop->HWInterface()->SetCursor(fAppCursor); // if (fAppCursor)
// fDesktop->HWInterface()->SetCursor(fAppCursor);
fDesktop->HWInterface()->SetCursorVisible(!fCursorHidden); fDesktop->HWInterface()->SetCursorVisible(!fCursorHidden);
} }
@@ -883,13 +894,13 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
// Attached data: 68 bytes of fAppCursor data // Attached data: 68 bytes of fAppCursor data
int8 cdata[68]; int8 cdata[68];
link.Read(cdata,68); link.Read(cdata, 68);
// Because we don't want an overaccumulation of these particular // Because we don't want an overaccumulation of these particular
// cursors, we will delete them if there is an existing one. It would // cursors, we will delete them if there is an existing one. It would
// otherwise be easy to crash the server by calling SetCursor a // otherwise be easy to crash the server by calling SetCursor a
// sufficient number of times // sufficient number of times
if(fAppCursor) if (fAppCursor)
fDesktop->GetCursorManager().DeleteCursor(fAppCursor->ID()); fDesktop->GetCursorManager().DeleteCursor(fAppCursor->ID());
fAppCursor = new ServerCursor(cdata); fAppCursor = new ServerCursor(cdata);
@@ -919,8 +930,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
fDesktop->HWInterface()->SetCursor(cursor); fDesktop->HWInterface()->SetCursor(cursor);
if (sync) { if (sync) {
// the application is expecting a reply, but plans to do literally nothing // the application is expecting a reply so that it
// with the data, so we'll just reuse the cursor token variable // knows the cursor shape has truely changed
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
fLink.Flush(); fLink.Flush();
} }
@@ -968,6 +979,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
fDesktop->GetCursorManager().DeleteCursor(ctoken); fDesktop->GetCursorManager().DeleteCursor(ctoken);
break; break;
} }
case AS_GET_SCROLLBAR_INFO: case AS_GET_SCROLLBAR_INFO:
{ {
STRACE(("ServerApp %s: Get ScrollBar info\n", Signature())); STRACE(("ServerApp %s: Get ScrollBar info\n", Signature()));