From cba9e9ece6b5aed7a0b5a5b663de637073e333db Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Tue, 3 Jan 2006 13:49:20 +0000 Subject: [PATCH] Moved picture handlers to DispatchViewMessage, otherwise they are never called as the view can be hidden git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15818 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerWindow.cpp | 72 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 36 deletions(-) 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;