File fix-candidate-does-not-hide-automatically.patch of Package ibus

From f9592f30a2c2ac9f3b331eddf00845d9584e3bdc Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 13 Jun 2025 15:57:37 +0900
Subject: [PATCH] ui/gtk3: Fix PageUp/PageDown buttons with hidding candidate
 popup

Gtk.Widget.show_all() changes the visibilities of the child widgets
and it's not good in case that the parent visibility depends on the
visibilities of child widgets. Also using no_show_all property could
introduce the more complicated logic to the candidate popup.

BUG=https://github.com/ibus/ibus/issues/2757
Fixes: https://github.com/ibus/ibus/commit/6ac6188
Fixes: https://github.com/ibus/ibus/commit/d5e6e71
---
 ui/gtk3/candidatepanel.vala | 7 +++++--
 ui/gtk3/panel.vala          | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
index a4137f052..3cc2c0861 100644
--- a/ui/gtk3/candidatepanel.vala
+++ b/ui/gtk3/candidatepanel.vala
@@ -214,7 +214,6 @@ public class CandidatePanel : Gtk.Box{
         m_set_preedit_text_id =
                 Timeout.add(100,
                             () => {
-                                //warning("test set_preedit_text_real");
                                 m_set_preedit_text_id = 0;
                                 set_preedit_text_real(text, cursor);
                                 return Source.REMOVE;
@@ -480,7 +479,11 @@ public class CandidatePanel : Gtk.Box{
     }
 
     public new void show() {
-        m_toplevel.show_all();
+        // m_toplevel.show_all() changes m_candidate_area.get_visible()
+        // in update_real() so show() is just used. Using no_show_all
+        // property for m_candidate_area would introduce the more
+        // complicated logic.
+        m_toplevel.show();
     }
 
     public new void hide() {
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
index d65ffbb3f..61ee2e43d 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
@@ -218,7 +218,7 @@ class Panel : IBus.PanelService {
 
 #if USE_GDK_WAYLAND
     private CandidatePanel get_active_candidate_panel() {
-        if (m_wayland_object_path == null) {
+        if (m_is_wayland && m_wayland_object_path == null) {
             if (m_candidate_panel_x11 == null) {
                 m_candidate_panel_x11 = candidate_panel_new(true);
                 set_use_glyph_from_engine_lang();
@@ -233,7 +233,7 @@ class Panel : IBus.PanelService {
     }
 
     private Switcher get_active_switcher() {
-        if (m_wayland_object_path == null) {
+        if (m_is_wayland && m_wayland_object_path == null) {
             if (m_switcher_x11 == null)
                 m_switcher_x11 = switcher_new(true);
             return m_switcher_x11;
openSUSE Build Service is sponsored by