From 072097cd06e5690cd11e1ab7884ec1b7ee235c43 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 17 May 2013 19:42:50 +0200 Subject: [PATCH] * Fix CComponents::getScreen()/hide() & CComponentsItem::hideCCItem() - Use CFrameBuffer::waitForIdle() to ensure that all GXA commands are finished before SaveScreen() / RestoreScreen() is executed --- src/gui/components/cc_base.cpp | 2 ++ src/gui/components/cc_item.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/gui/components/cc_base.cpp b/src/gui/components/cc_base.cpp index 70bfb3b44..8e0d7a5da 100644 --- a/src/gui/components/cc_base.cpp +++ b/src/gui/components/cc_base.cpp @@ -145,6 +145,7 @@ void CComponents::paintFbItems(bool do_save_bg) inline fb_pixel_t* CComponents::getScreen(int ax, int ay, int dx, int dy) { fb_pixel_t* pixbuf = new fb_pixel_t[dx * dy]; + frameBuffer->waitForIdle("CComponents::getScreen()"); frameBuffer->SaveScreen(ax, ay, dx, dy, pixbuf); return pixbuf; } @@ -154,6 +155,7 @@ inline void CComponents::hide() { for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].pixbuf != NULL){ + frameBuffer->waitForIdle("CComponents::hide()"); frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); delete[] v_fbdata[i].pixbuf; v_fbdata[i].pixbuf = NULL; diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 0e9985814..8da3b5ac2 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -112,6 +112,7 @@ void CComponentsItem::hideCCItem(bool no_restore) is_painted = false; if (saved_screen.pixbuf) { + frameBuffer->waitForIdle("CComponentsItem::hideCCItem()"); frameBuffer->RestoreScreen(saved_screen.x, saved_screen.y, saved_screen.dx, saved_screen.dy, saved_screen.pixbuf); if (no_restore) { delete[] saved_screen.pixbuf;