mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
src/gui/widget/menue.cpp try to fix widget segfault menu with keyboard and background restore
This commit is contained in:
@@ -622,6 +622,8 @@ void CMenuWidget::Init(const std::string &Icon, const int mwidth, const mn_widge
|
||||
fbutton_width = 0;
|
||||
fbutton_height = 0;
|
||||
nextShortcut = 1;
|
||||
saveScreen_width = 0;
|
||||
saveScreen_height = 0;
|
||||
}
|
||||
|
||||
void CMenuWidget::move(int xoff, int yoff)
|
||||
@@ -1391,17 +1393,18 @@ void CMenuWidget::saveScreen()
|
||||
return;
|
||||
|
||||
delete[] background;
|
||||
|
||||
background = new fb_pixel_t [full_width * (full_height+fbutton_height)];
|
||||
saveScreen_height = full_height+fbutton_height;
|
||||
saveScreen_width = full_width;
|
||||
background = new fb_pixel_t [saveScreen_height * saveScreen_width];
|
||||
if(background)
|
||||
frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background);
|
||||
frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, saveScreen_height, background);
|
||||
}
|
||||
|
||||
void CMenuWidget::restoreScreen()
|
||||
{
|
||||
if(background) {
|
||||
if(savescreen)
|
||||
frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background);
|
||||
frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, saveScreen_width, saveScreen_height, background);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1411,6 +1414,8 @@ void CMenuWidget::enableSaveScreen(bool enable)
|
||||
if (!enable && background) {
|
||||
delete[] background;
|
||||
background = NULL;
|
||||
saveScreen_width = 0;
|
||||
saveScreen_height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -494,6 +494,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals
|
||||
CComponentsInfoBox *info_box;
|
||||
int hint_height;
|
||||
CComponentsHeader *header;
|
||||
unsigned int saveScreen_width ;
|
||||
unsigned int saveScreen_height;
|
||||
protected:
|
||||
std::string nameString;
|
||||
neutrino_locale_t name;
|
||||
|
Reference in New Issue
Block a user