update notification before erasing finished ones
This commit is contained in:
parent
f43b34fb57
commit
c61a6289c5
1 changed files with 10 additions and 11 deletions
|
@ -1387,15 +1387,19 @@ void NotificationManager::update_notifications()
|
||||||
if (!top_level_wnd->IsActive())
|
if (!top_level_wnd->IsActive())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
static size_t last_size = m_pop_notifications.size();
|
//static size_t last_size = m_pop_notifications.size();
|
||||||
|
|
||||||
|
//request frames
|
||||||
|
int64_t next_render = std::numeric_limits<int64_t>::max();
|
||||||
for (auto it = m_pop_notifications.begin(); it != m_pop_notifications.end();) {
|
for (auto it = m_pop_notifications.begin(); it != m_pop_notifications.end();) {
|
||||||
std::unique_ptr<PopNotification>& notification = *it;
|
std::unique_ptr<PopNotification>& notification = *it;
|
||||||
|
notification->set_paused(m_hovered);
|
||||||
|
notification->update_state();
|
||||||
|
next_render = std::min<int64_t>(next_render, notification->next_render());
|
||||||
if (notification->get_state() == PopNotification::EState::Finished)
|
if (notification->get_state() == PopNotification::EState::Finished)
|
||||||
it = m_pop_notifications.erase(it);
|
it = m_pop_notifications.erase(it);
|
||||||
else {
|
else {
|
||||||
notification->set_paused(m_hovered);
|
|
||||||
notification->update_state();
|
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1436,16 +1440,11 @@ void NotificationManager::update_notifications()
|
||||||
if (m_requires_render)
|
if (m_requires_render)
|
||||||
m_requires_update = true;
|
m_requires_update = true;
|
||||||
*/
|
*/
|
||||||
//request frames
|
|
||||||
int64_t next_render = std::numeric_limits<int64_t>::max();
|
|
||||||
const int64_t max = std::numeric_limits<int64_t>::max();
|
|
||||||
for (const std::unique_ptr<PopNotification>& notification : m_pop_notifications) {
|
|
||||||
next_render = std::min<int64_t>(next_render, notification->next_render());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (next_render == 0)
|
if (next_render == 0)
|
||||||
wxGetApp().plater()->get_current_canvas3D()->request_extra_framee_delayed(33); //few milliseconds to get from GLCanvas::render
|
wxGetApp().plater()->get_current_canvas3D()->request_extra_frame_delayed(33); //few milliseconds to get from GLCanvas::render
|
||||||
else if (next_render < max)
|
else if (next_render < std::numeric_limits<int64_t>::max())
|
||||||
wxGetApp().plater()->get_current_canvas3D()->request_extra_frame_delayed(int(next_render));
|
wxGetApp().plater()->get_current_canvas3D()->request_extra_frame_delayed(int(next_render));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue