summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-06-12 13:33:46 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-31 10:35:11 +0000
commit286c53f217d5a8d634cb2b8c08d2c5a3db67158b (patch)
tree49db8879319ebec2d0c9f1f68322c83f2588e9c1 /src/plugins
parent256854cf9760f2b8e8702c2ce2066f67213c0169 (diff)
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>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index eb9e9c8b8d..6df454adb0 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -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)
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 859b55b0d8..b372ecd7c4 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -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)