avoid crash with vnc plugin
This commit is contained in:
parent
d42e27af5d
commit
a1d60803f2
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user