MCPcopy Create free account
hub / github.com/DISTRHO/DPF / stopModal

Method stopModal

dgl/src/WindowPrivateData.cpp:589–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587}
588
589void Window::PrivateData::stopModal()
590{
591 DGL_DBG("Window modal loop stopping...");
592
593 // deactivate modal mode
594 modal.enabled = false;
595
596 // safety checks, make sure we have a parent and we are currently active as the child to give focus to
597 if (modal.parent == nullptr)
598 return;
599 if (modal.parent->modal.child != this)
600 return;
601
602#ifdef DISTRHO_OS_MAC
603 puglMacOSRemoveChildWindow(modal.parent->view, view);
604#endif
605
606 // stop parent from giving focus to us, so it behaves like normal
607 modal.parent->modal.child = nullptr;
608
609 // refocus main window after closing child
610 if (! modal.parent->isClosed)
611 {
612 const Widget::MotionEvent ev;
613 modal.parent->onPuglMotion(ev);
614 modal.parent->focus();
615 }
616
617 DGL_DBG("Ok\n");
618}
619
620void Window::PrivateData::runAsModal(const bool blockWait)
621{

Callers

nothing calls this directly

Calls 2

onPuglMotionMethod · 0.80
focusMethod · 0.45

Tested by

no test coverage detected