diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 87460da965..c43bc6fb9f 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -1775,6 +1775,42 @@ if (ServerBitmap* bitmap = fServerApp->FindBitmap(bitmapToken)) { break; } + case AS_LAYER_BEGIN_PICTURE: + { + DTRACE(("ServerWindow %s: Message AS_LAYER_BEGIN_PICTURE\n", Title())); + ServerPicture *picture = App()->CreatePicture(); + fCurrentLayer->SetPicture(picture); + break; + } + + case AS_LAYER_APPEND_TO_PICTURE: + { + DTRACE(("ServerWindow %s: Message AS_LAYER_APPEND_TO_PICTURE\n", Title())); + + int32 pictureToken; + link.Read(&pictureToken); + + fCurrentLayer->SetPicture(App()->FindPicture(pictureToken)); + // we don't care if it's NULL + break; + } + + case AS_LAYER_END_PICTURE: + { + DTRACE(("ServerWindow %s: Message AS_LAYER_END_PICTURE\n", Title())); + + ServerPicture *picture = fCurrentLayer->Picture(); + if (picture != NULL) { + fCurrentLayer->SetPicture(NULL); + fLink.StartMessage(B_OK); + fLink.Attach(picture->Token()); + } else + fLink.StartMessage(B_ERROR); + + fLink.Flush(); + break; + } + default: if (fDesktop->LockSingleWindow()) { _DispatchViewDrawingMessage(code, link); @@ -2156,42 +2192,6 @@ ServerWindow::_DispatchViewDrawingMessage(int32 code, BPrivate::LinkReceiver &li break; } - case AS_LAYER_BEGIN_PICTURE: - { - DTRACE(("ServerWindow %s: Message AS_LAYER_BEGIN_PICTURE\n", Title())); - ServerPicture *picture = App()->CreatePicture(); - fCurrentLayer->SetPicture(picture); - break; - } - - case AS_LAYER_APPEND_TO_PICTURE: - { - DTRACE(("ServerWindow %s: Message AS_LAYER_APPEND_TO_PICTURE\n", Title())); - - int32 pictureToken; - link.Read(&pictureToken); - - fCurrentLayer->SetPicture(App()->FindPicture(pictureToken)); - // we don't care if it's NULL - break; - } - - case AS_LAYER_END_PICTURE: - { - DTRACE(("ServerWindow %s: Message AS_LAYER_END_PICTURE\n", Title())); - - ServerPicture *picture = fCurrentLayer->Picture(); - if (picture != NULL) { - fCurrentLayer->SetPicture(NULL); - fLink.StartMessage(B_OK); - fLink.Attach(picture->Token()); - } else - fLink.StartMessage(B_ERROR); - - fLink.Flush(); - break; - } - case AS_LAYER_DRAW_PICTURE: { int32 token;