MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / onFrameEnd

Function onFrameEnd

source/MRViewer/MRProgressBar.cpp:275–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void onFrameEnd()
276{
277 // this is needed to prevent unexpected closing on progress bar window in:
278 // ImGui::NewFrame() / ImGui::UpdateMouseMovingWindowNewFrame() / ImGui::FocusWindow()
279 // that can happen if progress bar is ordered on clicking to the window
280 // (for example on finish editing some InputFloat, clicking on window makes ImGui think this window is moving
281 // and close progress bar modal before it starts, task of progress bar is going but post-processing is not)
282 auto& inst = ProgressBarImpl::instance();
283 if ( !inst.isOrdered_ )
284 return;
285 auto ctx = ImGui::GetCurrentContext();
286 if ( !ctx )
287 return;
288 if ( !ctx->MovingWindow )
289 return;
290 if ( std::string( ctx->MovingWindow->Name ).ends_with( "###GlobalProgressBarPopup" ) )
291 return;
292 ctx->MovingWindow = nullptr;
293}
294
295void order( const char* name, const std::function<void()>& task, int taskCount )
296{

Callers 1

finishFrameMethod · 0.85

Calls 1

instanceFunction · 0.85

Tested by

no test coverage detected