| 587 | } |
| 588 | |
| 589 | void 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 | |
| 620 | void Window::PrivateData::runAsModal(const bool blockWait) |
| 621 | { |
nothing calls this directly
no test coverage detected