Fix composition on xcb with misconfigured ibus

If ibus has been set, but either isn't installed or doesn't launch, all
composition fails on xcb. This ensures we fallback to "compose" which
is needed for working composition on XCB.

Change-Id: Ic2061c330bcb907759a13920c3eede14f3036563
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Allan Sandfeld Jensen 2017-06-12 13:33:46 +02:00
parent 256854cf97
commit 286c53f217
2 changed files with 5 additions and 2 deletions

View File

@ -133,7 +133,7 @@ QIBusPlatformInputContext::~QIBusPlatformInputContext (void)
bool QIBusPlatformInputContext::isValid() const
{
return d->valid;
return d->valid && d->busConnected;
}
void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int)

View File

@ -289,12 +289,15 @@ QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const
void QXcbIntegration::initialize()
{
const QLatin1String defaultInputContext("compose");
// Perform everything that may potentially need the event dispatcher (timers, socket
// notifiers) here instead of the constructor.
QString icStr = QPlatformInputContextFactory::requested();
if (icStr.isNull())
icStr = QLatin1String("compose");
icStr = defaultInputContext;
m_inputContext.reset(QPlatformInputContextFactory::create(icStr));
if (!m_inputContext && icStr != defaultInputContext && icStr != QLatin1String("none"))
m_inputContext.reset(QPlatformInputContextFactory::create(defaultInputContext));
}
void QXcbIntegration::moveToScreen(QWindow *window, int screen)