From fb8cd0751d25f44c66034488df3c579020facf89 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Fri, 15 Mar 2019 06:37:59 +0000 Subject: [PATCH] Bug 1508302 - Make IMContextWrapper::GetIMEName() refer XMODIFIERS env when gtk_im_multicontext_get_context_id() returns "wayland" r=m_kato On Wayland, `gtk_im_multicontext_get_context_id()` returns `"wayland"`. However, we need to know actual IM which works behind Wayland. Fortunately, `XMODIFIERS` env includes IME name like "xim" case. Therefore, we can refer it instead. Differential Revision: https://phabricator.services.mozilla.com/D23469 --HG-- extra : moz-landing-system : lando --- widget/gtk/IMContextWrapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widget/gtk/IMContextWrapper.cpp b/widget/gtk/IMContextWrapper.cpp index a90f48fd4229..2c0ff54e9cb2 100644 --- a/widget/gtk/IMContextWrapper.cpp +++ b/widget/gtk/IMContextWrapper.cpp @@ -406,7 +406,8 @@ nsDependentCSubstring IMContextWrapper::GetIMName() const { // If the context is XIM, actual engine must be specified with // |XMODIFIERS=@im=foo|. const char* xmodifiersChar = PR_GetEnv("XMODIFIERS"); - if (!im.EqualsLiteral("xim") || !xmodifiersChar) { + if (!xmodifiersChar || + (!im.EqualsLiteral("xim") && !im.EqualsLiteral("wayland"))) { return im; }