avoid crash with vnc plugin

This commit is contained in:
Uwe Rathmann 2022-04-11 12:05:00 +02:00
parent d42e27af5d
commit a1d60803f2

View File

@ -183,13 +183,12 @@ static QPointer< QskInputContext > qskInputContext;
static void qskSendToPlatformContext( QEvent::Type type )
{
const auto platformInputContext =
QGuiApplicationPrivate::platformIntegration()->inputContext();
const auto integration = QGuiApplicationPrivate::platformIntegration();
if ( platformInputContext )
if ( const auto inputContext = integration->inputContext() )
{
QEvent event( type );
QCoreApplication::sendEvent( platformInputContext, &event );
QCoreApplication::sendEvent( inputContext, &event );
}
}
@ -208,9 +207,12 @@ void QskInputContext::setInstance( QskInputContext* inputContext )
qskInputContext = inputContext;
if ( oldContext && oldContext->parent() == nullptr )
{
delete oldContext;
qskSendToPlatformContext( QEvent::PlatformPanel );
// still needed with > Qt 5.15 ?
qskSendToPlatformContext( QEvent::PlatformPanel );
}
}
}