Fix possible crash in web apps.

This commit is contained in:
John Preston 2024-07-30 12:40:33 +02:00
parent 8b2bbfba6a
commit 4108debca0

View file

@ -746,8 +746,9 @@ postEvent: function(eventType, eventData) {
&QGuiApplication::focusWindowChanged
) | rpl::filter([=](QWindow *focused) {
const auto handle = _widget->window()->windowHandle();
return _webview
&& !_webview->window.widget()->isHidden()
const auto widget = _webview ? _webview->window.widget() : nullptr;
return widget
&& !widget->isHidden()
&& handle
&& (focused == handle);
}) | rpl::start_with_next([=] {