public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Takao Fujiwara <tfujiwar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ibus] autotool: Resolves: #2088656 Hide XKB engine but enable it in Plasma Wayland
Date: Sun, 31 May 2026 02:07:51 GMT	[thread overview]
Message-ID: <178019327184.1.4476556273813006152.rpms-ibus-9da0396a49f3@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/ibus
Branch : autotool
Commit : 9da0396a49f329bc78283620caf3152aa253c0a5
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date   : 2022-06-02T16:57:37+09:00
Stats  : +123/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/ibus/c/9da0396a49f329bc78283620caf3152aa253c0a5?branch=autotool

Log:
Resolves: #2088656 Hide XKB engine but enable it in Plasma Wayland

---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index f789581..a3fe827 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -1094,3 +1094,122 @@ index f8dced6b..92464234 100755
 -- 
 2.35.3
 
+From 85b381d531b8fc319e627a5e9d4b815f34a50e2f Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Thu, 2 Jun 2022 16:47:10 +0900
+Subject: [PATCH] ui/gtk3: Hide XKB engine but enable it in Plasma Wayland
+
+IBus just cannot forward key events in Plasma Wayland because
+IBus has to handle the compose keys.
+
+BUG=rhbz#2088656
+---
+ ui/gtk3/panel.vala | 46 +++++++++++++++++++++++++++++-----------------
+ 1 file changed, 29 insertions(+), 17 deletions(-)
+
+diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
+index 61bfa1b6..900f0168 100644
+--- a/ui/gtk3/panel.vala
++++ b/ui/gtk3/panel.vala
+@@ -41,6 +41,7 @@ class Panel : IBus.PanelService {
+     private Gtk.Menu m_ime_menu;
+     private Gtk.Menu m_sys_menu;
+     private IBus.EngineDesc[] m_engines = {};
++    private IBus.EngineDesc m_en_engine;
+     private GLib.HashTable<string, IBus.EngineDesc> m_engine_contexts =
+             new GLib.HashTable<string, IBus.EngineDesc>(GLib.str_hash,
+                                                         GLib.str_equal);
+@@ -910,13 +911,20 @@ class Panel : IBus.PanelService {
+     }
+ 
+     private void switch_engine(int i, bool force = false) {
+-        GLib.assert(i >= 0 && i < m_engines.length);
++        if (m_is_wayland)
++            GLib.assert(i >= 0 && i <= m_engines.length);
++        else
++            GLib.assert(i >= 0 && i < m_engines.length);
+ 
+         // Do not need switch
+         if (i == 0 && !force)
+             return;
+ 
+-        IBus.EngineDesc engine = m_engines[i];
++        IBus.EngineDesc engine;
++        if (m_is_wayland && m_engines.length == 0)
++            engine = m_en_engine;
++        else
++            engine = m_engines[i];
+ 
+         set_engine(engine);
+     }
+@@ -1006,17 +1014,15 @@ class Panel : IBus.PanelService {
+                                 string[]? order_names) {
+         string[]? engine_names = unowned_engine_names;
+ 
+-        if (engine_names == null || engine_names.length == 0) {
+-            if (m_is_wayland)
+-                engine_names = {};
+-            else
+-                engine_names = {"xkb:us::eng"};
+-        }
++        if (engine_names == null || engine_names.length == 0)
++            engine_names = {"xkb:us::eng"};
+ 
+         string[] names = {};
+ 
+         foreach (var name in order_names) {
+             if (m_is_wayland && name.has_prefix("xkb:"))
++                name = "xkb:us::eng";
++            if (name in names)
+                 continue;
+             if (name in engine_names)
+                 names += name;
+@@ -1024,7 +1030,7 @@ class Panel : IBus.PanelService {
+ 
+         foreach (var name in engine_names) {
+             if (m_is_wayland && name.has_prefix("xkb:"))
+-                continue;
++                name = "xkb:us::eng";
+             if (name in names)
+                 continue;
+             names += name;
+@@ -1065,14 +1071,20 @@ class Panel : IBus.PanelService {
+ 	}
+ 
+         if (m_engines.length == 0) {
+-            if (engines.length > 0) {
+-                m_engines = engines;
+-                switch_engine(0, true);
+-                run_preload_engines(engines, 1);
+-            } else {
+-                m_candidate_panel.set_language(new Pango.AttrLanguage(
+-                        Pango.Language.from_string(null)));
++            m_engines = engines;
++            // Do not show engines in panel icon and suggest systemsettings5
++            // in Plasma Wayland in case all engines are XKB.
++            if (m_is_wayland && m_engines.length == 1 &&
++                m_engines[0].get_name() == "xkb:us::eng") {
++                m_engines = {};
++                if (m_en_engine == null) {
++                    m_en_engine =
++                            m_bus.get_engines_by_names({"xkb:us::eng"})[0];
++                }
+             }
++            switch_engine(0, true);
++            if (m_engines.length > 0)
++                run_preload_engines(m_engines, 1);
+         } else {
+             var current_engine = m_engines[0];
+             m_engines = engines;
+@@ -1566,7 +1578,7 @@ class Panel : IBus.PanelService {
+ 
+             if (engine != null) {
+                 var name = engine.get_name();
+-                if (name.length >= 4 && name[0:4] == "xkb:")
++                if (!m_is_wayland && name.length >= 4 && name[0:4] == "xkb:")
+                     language = m_switcher.get_xkb_language(engine);
+             }
+ 
+-- 
+2.35.3
+

diff --git a/ibus.spec b/ibus.spec
index 38acda0..b8774cf 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -39,7 +39,7 @@
 
 Name:           ibus
 Version:        1.5.26
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        Intelligent Input Bus for Linux OS
 License:        LGPLv2+
 URL:            https://github.com/ibus/%name/wiki
@@ -522,6 +522,9 @@ dconf update || :
 %{_datadir}/installed-tests/ibus
 
 %changelog
+* Thu Jun 02 2022 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.26-8
+- Resolves: #2088656 Hide XKB engine but enable it in Plasma Wayland
+
 * Wed May 25 2022 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.26-7
 - Update xkb-latin-layouts gsettings
 

                 reply	other threads:[~2026-05-31  2:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178019327184.1.4476556273813006152.rpms-ibus-9da0396a49f3@fedoraproject.org \
    --to=tfujiwar@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox