From d31fe6eef8b8c8d284ae1bc5899b0ad1d4d2c21d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 30 Oct 2013 11:29:25 +0100 Subject: [PATCH] CComponentsItem: add missing is_painted to hideCCItem() Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4ed6e54da686a3c54bbc330cc6321ff5777297db Author: Thilo Graf Date: 2013-10-30 (Wed, 30 Oct 2013) --- src/gui/components/cc_item.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 07d621e96..0ab26c35d 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -107,21 +107,25 @@ void CComponentsItem::paintInit(bool do_save_bg) } //restore last saved screen behind form box, -//Do use parameter 'no restore' to override temporarly the restore funtionality. -//This could help to avoid ugly flicker efffects if it is necessary e.g. on often repaints, without changed contents. +//Do use parameter 'no restore' to override the restore funtionality. +//For embedded items is it mostly not required to restore saved screens, so no_resore=true also is default parameter +//for such items. +//This member ensures demage of already existing screen buffer too, if parameter no_restore was changed while runtime. void CComponentsItem::hideCCItem(bool no_restore) { - is_painted = false; - + //restore saved screen if available 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; - saved_screen.pixbuf = NULL; - firstPaint = true; - } + + if (no_restore) { //on parameter no restore=true delete saved screen if available + delete[] saved_screen.pixbuf; + saved_screen.pixbuf = NULL; + firstPaint = true; + } } + + is_painted = false; } void CComponentsItem::hide(bool no_restore)