2 Commits

8 changed files with 124 additions and 279 deletions

60
20-ibus-plasma-setup.sh Normal file
View File

@@ -0,0 +1,60 @@
#!/bin/sh
#
# If the virtual keyboard of Plasma Wayland has not been configured,
# configure it for this IM.
#
im_name="ibus"
desktop_file="/usr/share/applications/org.freedesktop.IBus.Panel.Wayland.Gtk3.desktop"
# Do nothing for X11 session
if [ "$XDG_SESSION_TYPE" != "wayland" ]; then
exit 0
fi
# Do nothing if kreadconfig6 is not available
if ! command -v kreadconfig6 >/dev/null 2>&1; then
exit 0
fi
# check current virtual keyboard
current_im=$(kreadconfig6 --file kwinrc --group Wayland --key InputMethod)
#
# initialize virtual keyboard if not configured yet
#
# check if $XDG_CONFIG_HOME/plasma_wayland_input_method_configured does not exist
config_dir="${XDG_CONFIG_HOME:-$HOME/.config}"
stamp_file="$config_dir/plasma_wayland_input_method_configured"
if [ ! -e "$stamp_file" ]; then
mkdir -p "$config_dir"
echo "$im_name" > "$stamp_file"
# check current virtual keyboard is None
if [ -z "$current_im" ]; then
# The virtual keyboard is not configured
echo "$0 is configuring the virtual keyboard for IBus."
current_im=$desktop_file
kwriteconfig6 --file kwinrc --group Wayland --key InputMethod $current_im
else
echo "$0 detected a virtual keyboard configured."
fi
fi
#
# export environment variables for applications running on Xwayland
#
if [ "$current_im" = "$desktop_file" ]; then
# do not override Qt IM module settings
if [ -z "$QT_IM_MODULE" ] && [ -z "$QT_IM_MODULES" ]; then
echo "$0 is setting QT_IM_MODULES for $im_name."
export QT_IM_MODULES="wayland;$im_name"
fi
# do not override xim settings
if [ -z "$XMODIFIERS" ]; then
echo "$0 is setting XMODIFIERS for $im_name."
export XMODIFIERS="@im=$im_name"
fi
fi

Binary file not shown.

BIN
ibus-1.5.33.tar.gz Normal file

Binary file not shown.

View File

@@ -1,5 +1,12 @@
#!/bin/sh
#
# Normal start process for X11 session
# Note that INPUT_METHOD is not usually set under a Wayland session.
#
# For Plasma Wayland, see also /usr/etc/xdg/plasma-workspace/env/20-ibus-plasma-setup.sh.
# To configure input method (virtual keyboard), please use KDE System Settings rather than
# INPUT_METHOD variable.
test x"$INPUT_METHOD" = x"ibus" || exit 0
# GNOME starts ibus by itself
@@ -11,6 +18,7 @@ esac
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
case "$XDG_CURRENT_DESKTOP" in
*KDE*)
# This will update kwinrc and set IBus for the active virtual keyboard
ibus start --type=kde-wayland
exit 0;;
*)

View File

@@ -1,12 +0,0 @@
diff -Nur ibus-1.5.29/ui/gtk3/panel.vala ibus-1.5.29-new/ui/gtk3/panel.vala
--- ibus-1.5.29/ui/gtk3/panel.vala 2023-11-30 23:08:12.858426343 +0800
+++ ibus-1.5.29-new/ui/gtk3/panel.vala 2023-11-30 23:08:43.015089972 +0800
@@ -1361,7 +1361,7 @@
private void show_setup_dialog() {
if (m_setup_pid != 0) {
- if (Posix.kill(m_setup_pid, Posix.Signal.USR1) == 0)
+ if (Posix.kill(m_setup_pid, Posix.SIGUSR1) == 0)
return;
m_setup_pid = 0;
}

View File

@@ -1,249 +0,0 @@
diff -Naur ibus-1.5.25/src/ibusshare.c ibus-1.5.25.new/src/ibusshare.c
--- ibus-1.5.25/src/ibusshare.c 2021-08-20 02:48:40.000000000 +0200
+++ ibus-1.5.25.new/src/ibusshare.c 2021-09-08 19:41:27.233077477 +0200
@@ -90,79 +90,132 @@
return g_getenv("IBUS_SESSION_ID");
}
+static const gchar *ibus_get_socket_path_internal (gboolean compat, gchar *client_display);
+
const gchar *
ibus_get_socket_path (void)
{
static gchar *path = NULL;
if (path == NULL) {
- gchar *hostname = "unix";
- gchar *display;
- gchar *displaynumber = "0";
- /* gchar *screennumber = "0"; */
- gboolean is_wayland = FALSE;
- gchar *p;
-
- path = g_strdup (g_getenv ("IBUS_ADDRESS_FILE"));
- if (path != NULL) {
- return path;
+ path = ibus_get_socket_path_internal (FALSE, NULL);
+ }
+ return path;
+}
+
+static const gchar *
+ibus_get_socket_path_x11_compat (void)
+{
+ static gchar *path = NULL;
+ if (path == NULL)
+ path = ibus_get_socket_path_internal (TRUE, NULL);
+ return path;
+}
+
+static const gchar *
+ibus_get_socket_path_gnome_xwayland_compat (void)
+{
+ static gchar *path = NULL;
+ if (path == NULL) {
+ gint setup_display_number;
+ gchar *client_display;
+ gchar **tokens;
+
+ tokens = g_strsplit (ibus_get_socket_path_x11_compat (), "-", 3);
+ if (tokens[0] != NULL && tokens[1] != NULL && tokens[2] != NULL) {
+ setup_display_number = g_strtod(tokens[2], NULL);
+ if (setup_display_number > 0) {
+ client_display = g_strdup_printf (":%d", setup_display_number - 1);
+ path = ibus_get_socket_path_internal (TRUE, client_display);
+ }
}
- if (_display == NULL) {
+ g_strfreev (tokens);
+ }
+ return path;
+}
+
+static const gchar *
+ibus_get_socket_path_internal (gboolean compat, gchar *client_display)
+{
+ gchar *path = NULL;
+
+ gchar *hostname = "unix";
+ gchar *display;
+ gchar *displaynumber = "0";
+ /* gchar *screennumber = "0"; */
+ gboolean is_wayland = FALSE;
+ gchar *p;
+
+ path = g_strdup (g_getenv ("IBUS_ADDRESS_FILE"));
+ if (path != NULL) {
+ return path;
+ }
+
+ if (_display == NULL) {
+ if (compat) {
+ if (client_display == NULL)
+ display = g_strdup (g_getenv ("DISPLAY"));
+ else
+ display = client_display;
+ } else {
display = g_strdup (g_getenv ("WAYLAND_DISPLAY"));
if (display)
is_wayland = TRUE;
- else
+ else if (client_display == NULL)
display = g_strdup (g_getenv ("DISPLAY"));
+ else
+ display = client_display;
}
- else {
- display = g_strdup (_display);
- }
-
- if (is_wayland) {
- displaynumber = display;
- } else if (display) {
- p = display;
- hostname = display;
- for (; *p != ':' && *p != '\0'; p++);
+ }
+ else {
+ display = g_strdup (_display);
+ }
- if (*p == ':') {
- *p = '\0';
- p++;
- displaynumber = p;
- }
+ if (is_wayland) {
+ displaynumber = display;
+ } else if (display) {
+ p = display;
+ hostname = display;
+ for (; *p != ':' && *p != '\0'; p++);
+
+ if (*p == ':') {
+ *p = '\0';
+ p++;
+ displaynumber = p;
+ }
- for (; *p != '.' && *p != '\0'; p++);
+ for (; *p != '.' && *p != '\0'; p++);
- if (*p == '.') {
- *p = '\0';
- p++;
- /* Do not use screennumber
- screennumber = p; */
- }
+ if (*p == '.') {
+ *p = '\0';
+ p++;
+ /* Do not use screennumber
+ screennumber = p; */
}
+ }
- if (hostname[0] == '\0')
- hostname = "unix";
+ if (hostname[0] == '\0')
+ hostname = "unix";
+
+ p = g_strdup_printf ("%s-%s-%s",
+ ibus_get_local_machine_id (),
+ hostname,
+ displaynumber);
+ /* Qt5 IBus module has a hard-coded path and we cannot change this
+ * for the back compatibility.
+ * XDG_RUNTIME_DIR is not useful because it's generated by
+ * login but not `su` command and ibus-daemon can be run with `su`
+ * and we may change the path to XDG_CACHE_HOME in the future.
+ */
+ path = g_build_filename (g_get_user_config_dir (),
+ "ibus",
+ "bus",
+ p,
+ NULL);
+ g_free (p);
+ g_free (display);
- p = g_strdup_printf ("%s-%s-%s",
- ibus_get_local_machine_id (),
- hostname,
- displaynumber);
- /* Qt5 IBus module has a hard-coded path and we cannot change this
- * for the back compatibility.
- * XDG_RUNTIME_DIR is not useful because it's generated by
- * login but not `su` command and ibus-daemon can be run with `su`
- * and we may change the path to XDG_CACHE_HOME in the future.
- */
- path = g_build_filename (g_get_user_config_dir (),
- "ibus",
- "bus",
- p,
- NULL);
- g_free (p);
- g_free (display);
- }
return path;
}
@@ -243,14 +296,42 @@
return address;
}
+static void ibus_write_address_internal (const gchar *address, const gchar *socket_path);
+
void
ibus_write_address (const gchar *address)
{
+
+
+ const gchar *socket_path;
+ const gchar *socket_path_compat;
+
+ socket_path = ibus_get_socket_path ();
+ ibus_write_address_internal (address, socket_path);
+
+ if (g_getenv ("WAYLAND_DISPLAY") != NULL) {
+ socket_path_compat = ibus_get_socket_path_x11_compat ();
+ ibus_write_address_internal (address, socket_path_compat);
+
+ if (g_getenv ("GNOME_SETUP_DISPLAY") != NULL &&
+ strcmp (g_getenv ("GNOME_SETUP_DISPLAY"), g_getenv ("DISPLAY")) == 0) {
+ /* Running from gnome-shell with the setup display; write the socket
++ * address to an additional path for X11 clients */
+ socket_path_compat = ibus_get_socket_path_gnome_xwayland_compat ();
+ if (socket_path_compat != NULL)
+ ibus_write_address_internal (address, socket_path_compat);
+ }
+ }
+}
+
+static void
+ibus_write_address_internal (const gchar *address, const gchar *socket_path)
+{
FILE *pf;
gchar *path;
g_return_if_fail (address != NULL);
- path = g_path_get_dirname (ibus_get_socket_path ());
+ path = g_path_get_dirname (socket_path);
errno = 0;
if (g_mkdir_with_parents (path, 0700)) {
g_warning ("Failed to mkdir %s: %s", path, g_strerror (errno));
@@ -260,11 +341,11 @@
g_free (path);
errno = 0;
- if (g_unlink (ibus_get_socket_path ())) {
+ if (g_unlink (socket_path)) {
g_warning ("Failed to unlink %s: %s",
- ibus_get_socket_path (), g_strerror (errno));
+ socket_path, g_strerror (errno));
}
- pf = fopen (ibus_get_socket_path (), "w");
+ pf = fopen (socket_path, "w");
g_return_if_fail (pf != NULL);
fprintf (pf,

View File

@@ -1,3 +1,38 @@
-------------------------------------------------------------------
Wed Nov 19 14:14:39 UTC 2025 - Fuminobu Takeyama <ftake@geeko.jp> - 1.5.33
- Upstream update to 1.5.33
* Fix reset signal w/ GTK_IM_MODULE=ibus in Wayland
* Provide preedit semantic APIs
* Do not load en-US compose table by default
* IBus 1.5.33 will insert "include %L" in your compose file
automatically generated by old IBus versions
* Implement IBusMessage
* Improve BEPO compose sequence visuals
* Update simple.xml with xkeyboard-config 2.45
* Update ibusunicodegen.h with Unicode 17.0.0
* Bug fixes for Wayland input-method
* Fix PageUp/PageDown buttons with hiding candidate popup
* Drop fix-candidate-does-not-hide-automatically.patch
* Fix leaks and buffer overflows
- Drop patches for unmaintained distributions
* ibus-fix-Signal-does-not-exist.patch
* ibus-socket-name-compatibility.patch
-------------------------------------------------------------------
Mon Sep 22 12:53:08 UTC 2025 - Hillwood Yang <hillwood@opensuse.org>
- Add fix-candidate-does-not-hide-automatically.patch
* Fix PageUp/PageDown buttons with hidding candidate popup
-------------------------------------------------------------------
Mon Sep 15 13:45:03 UTC 2025 - Fuminobu Takeyama <ftake@geeko.jp>
- Add an initial setup feature for Plasma Wayland
* enables IBus as the active virtual keyboard on the first login,
allowing users to input text using IBus without manual configuration
* Fix boo#1084804, boo#1246423
-------------------------------------------------------------------
Sat Jun 14 08:35:05 UTC 2025 - Takashi Iwai <tiwai@suse.com>
@@ -66,6 +101,17 @@ Sun Jul 7 09:23:53 UTC 2024 - Fuminobu Takeyama <ftake@geeko.jp> - 1.5.30
* Fix typing freeze with barcode reader
* Fix preedit issue with X applications
* setup/enginedialog: Improve the search for engines
* After libX11 is fixed about the XIM jumbled input issues, too quick
focus change can causes a freeze with barcode reader.
(bsc#1252250)
* Fix the synchronous "ProcessKeyEvent" D-Bus method in ibus-x11 too.
(bsc#1252250)
* The synchronous "ProcessKeyEvent" D-Bus method cannot receive
"CommitText" and "ForwardKeyEvent" D-Bus signals during calling
the method. To resolve the issue, now Add
ibus_input_context_set_post_process_key_event() and
ibus_input_context_post_process_key_event().
(bsc#1252250)
- Refresh ibus-ui-gtk3-restart-via-systemd.patch
- Drop patches merged by the upstream
* ibus-complete-preedit-signals-for-postprocesskeyevent.patch

View File

@@ -2,6 +2,7 @@
# spec file for package ibus
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -34,7 +35,7 @@
%define _name ibus
Name: %{_name}%{?nsuffix}
Version: 1.5.32
Version: 1.5.33
Release: 0
Summary: The "Intelligent Input Bus" input method
License: LGPL-2.1-or-later
@@ -48,6 +49,7 @@ Source7: macros.ibus
Source10: ibus-autostart
Source11: ibus-autostart.desktop
Source12: 20-defaults-openSUSE.conf
Source13: 20-ibus-plasma-setup.sh
Source99: baselibs.conf
# PATFH-FIX-OPENSUSE ibus-xim-fix-re-focus-after-lock.patch bnc#874869 tiwai@suse.de
# Fix lost XIM input after screenlock
@@ -55,9 +57,6 @@ Patch4: ibus-xim-fix-re-focus-after-lock.patch
# PATCH-FIX-UPSTREAM ftake@geeko.jp
# Select an IM engine instead of xkb engine at the first login
Patch8: im-engines-precede-xkb.patch
# PATCH-FIX-OPENSUSE ibus-fix-Signal-does-not-exist.patch hillwood@opensuse.org
# panel.vala: The name `Signal' does not exist in the context of `Posix' in Leap 15.1 and below
Patch9: ibus-fix-Signal-does-not-exist.patch
# PATCH-FIX-SLE hide-setup-menu.patch bnc#899259 qzhao@suse.com
# ibus-setup should not launch from main menu.
Patch10: hide-setup-menu.patch
@@ -67,11 +66,6 @@ Patch11: setup-switch-im.patch
# PATCH-FIX-SLE ibus-disable-engines-preload-in-GNOME.patch bnc#1036729 qzhao@suse.com
# Disable ibus engines preload in GNOME for These works are handled by gnome-shell.
Patch12: ibus-disable-engines-preload-in-GNOME.patch
# PATCH-FIX-UPSTREAM ibus-socket-name-compatibility.patch bsc#1171442, gh#ibus/ibus#2195 qkzhu@suse
# Compatibility workaround for ibus-use-wayland-display-for-socket-name.patch
# Qt5 does not be update to the new version and patch for ibus on Leap 15,
# it still needs this patch on leap 15. (boo#1187202)
Patch15: ibus-socket-name-compatibility.patch
BuildRequires: pkgconfig(dbusmenu-glib-0.4)
BuildRequires: pkgconfig(dbusmenu-gtk3-0.4)
BuildRequires: pkgconfig(glib-2.0) >= 2.84.0
@@ -214,9 +208,6 @@ This package contains ibus im module for use by gtk4.
%setup -q -n %{_name}-%{version}
%patch -P 4 -p1
%patch -P 8 -p1
%if 0%{?sle_version} < 150200 && 0%{?suse_version} <=1500
%patch -P 9 -p1
%endif
cp -r %{SOURCE2} .
cp -r %{SOURCE3} .
@@ -228,9 +219,6 @@ cp -r %{SOURCE11} .
%patch -P 10 -p1
%patch -P 11 -p1
%patch -P 12 -p1
%if 0%{?suse_version} <= 1500
%patch -P 15 -p1
%endif
%build
%configure --disable-static \
@@ -286,6 +274,9 @@ install -c -m 0644 ibus-autostart.desktop %{buildroot}%{_sysconfdir}/xdg/autosta
mkdir -p %{buildroot}%{_userunitdir}/org.freedesktop.IBus.session.generic.service.d
install -c -m 0644 %{SOURCE12} %{buildroot}%{_userunitdir}/org.freedesktop.IBus.session.generic.service.d
# setup script for Plasma
install -D -m 0755 %{SOURCE13} %{buildroot}%{_distconfdir}/xdg/plasma-workspace/env/20-ibus-plasma-setup.sh
PRIORITY=40
pushd %{buildroot}%{_distconfdir}/X11/xim.d/
for lang in am ar as bn el fa gu he hi hr ja ka kk kn ko lo ml my \
@@ -360,6 +351,7 @@ rm -rf %{buildroot}%{_libdir}/libibus*
rm -rf %{buildroot}%{_libdir}/pkgconfig
rm -rf %{buildroot}%{_prefix}/lib/systemd
rm -rf %{buildroot}%{_sysconfdir}/xdg
rm -rf %{buildroot}%{_distconfdir}/xdg
%post -n %{_name}-gtk4
%{gtk4_immodule_post}
@@ -418,6 +410,9 @@ fi
%config %{_sysconfdir}/dconf/db/ibus.d/00-upstream-settings
%config %{_sysconfdir}/dconf/profile/ibus
%config %{_sysconfdir}/xdg/autostart/ibus-autostart.desktop
%dir %{_distconfdir}/xdg/plasma-workspace
%dir %{_distconfdir}/xdg/plasma-workspace/env
%{_distconfdir}/xdg/plasma-workspace/env/20-ibus-plasma-setup.sh
%{_mandir}/man1/ibus.1%{ext_man}
%{_mandir}/man1/ibus-daemon.1%{ext_man}
%{_mandir}/man1/ibus-setup.1%{ext_man}