| 1494 | } |
| 1495 | |
| 1496 | Window::Controller *Application::findWindow( |
| 1497 | not_null<QWidget*> widget) const { |
| 1498 | const auto window = widget->window(); |
| 1499 | if (_lastActiveWindow && _lastActiveWindow->widget() == window) { |
| 1500 | return _lastActiveWindow; |
| 1501 | } |
| 1502 | for (const auto &[id, controller] : _windows) { |
| 1503 | if (controller->widget() == window) { |
| 1504 | return controller.get(); |
| 1505 | } |
| 1506 | } |
| 1507 | return nullptr; |
| 1508 | } |
| 1509 | |
| 1510 | Window::Controller *Application::activeWindow() const { |
| 1511 | return _lastActiveWindow; |
no test coverage detected