Compare commits

...

No commits in common. "imports/c8-beta/ibus-1.5.19-4.el8" and "c8" have entirely different histories.

11 changed files with 4981 additions and 12 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/ibus-1.5.19.tar.gz
SOURCES/ibus-po-1.5.19-20180822.tar.gz
SOURCES/ibus-po-1.5.19-20210706.tar.gz

View File

@ -1,2 +1,2 @@
fdda025d81247e40ad7acf953c2a0a606d18e965 SOURCES/ibus-1.5.19.tar.gz
36b017eddba8bc0dd970acaa2cab41d0053d6c9f SOURCES/ibus-po-1.5.19-20180822.tar.gz
236f5dc3c072d0587e107ae75084454c791bbf73 SOURCES/ibus-po-1.5.19-20210706.tar.gz

View File

@ -0,0 +1,48 @@
From 0f5084e07c215d74adc4eeeda40b374855cce59a Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 11 Jan 2019 12:56:42 +0900
Subject: [PATCH] src/ibuscomposetable: Replace assert with warning for
.XCompose
BUG=rhbz#1470673
---
src/ibuscomposetable.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
index b843e7e1..1c0ece41 100644
--- a/src/ibuscomposetable.c
+++ b/src/ibuscomposetable.c
@@ -1,7 +1,7 @@
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
/* ibus - The Input Bus
* Copyright (C) 2013-2014 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2013-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2013-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -98,14 +98,16 @@ parse_compose_value (IBusComposeData *compose_data,
uch = words[1][1];
/* The escaped string "\"" is separated with '\\' and '"'. */
- if (uch == '\0' && words[2][0] == '"')
+ if (uch == '\0' && words[2][0] == '"') {
uch = '"';
/* The escaped octal */
- else if (uch >= '0' && uch <= '8')
+ } else if (uch >= '0' && uch <= '8') {
uch = g_ascii_strtoll(words[1] + 1, NULL, 8);
/* If we need to handle other escape sequences. */
- else if (uch != '\\')
- g_assert_not_reached ();
+ } else if (uch != '\\') {
+ g_warning ("Invalid backslash: %s: %s", val, line);
+ goto fail;
+ }
}
if (g_utf8_get_char (g_utf8_next_char (words[1])) > 0) {
--
2.21.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,179 @@
From 3d442dbf936d197aa11ca0a71663c2bc61696151 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 13 Sep 2019 15:59:03 +0900
Subject: [PATCH] bus: Implement GDBusAuthObserver callback
ibus uses a GDBusServer with G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS,
and doesn't set a GDBusAuthObserver, which allows anyone who can connect
to its AF_UNIX socket to authenticate and be authorized to send method calls.
It also seems to use an abstract AF_UNIX socket, which does not have
filesystem permissions, so the practical effect might be that a local
attacker can connect to another user's ibus service and make arbitrary
method calls.
BUGS=rhbz#1717958
---
bus/server.c | 89 ++++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 73 insertions(+), 16 deletions(-)
diff --git a/bus/server.c b/bus/server.c
index 3a626230..2439de14 100644
--- a/bus/server.c
+++ b/bus/server.c
@@ -2,7 +2,8 @@
/* vim:set et sts=4: */
/* bus - The Input Bus
* Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2008-2010 Red Hat, Inc.
+ * Copyright (C) 2011-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2019 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -70,16 +71,63 @@ _restart_server (void)
}
/**
+ * bus_allow_mechanism_cb:
+ * @observer: A #GDBusAuthObserver.
+ * @mechanism: The name of the mechanism.
+ * @user_data: always %NULL.
+ *
+ * Check if @mechanism can be used to authenticate the other peer.
+ * Returns: %TRUE if the peer's mechanism is allowed.
+ */
+static gboolean
+bus_allow_mechanism_cb (GDBusAuthObserver *observer,
+ const gchar *mechanism,
+ G_GNUC_UNUSED gpointer user_data)
+{
+ if (g_strcmp0 (mechanism, "EXTERNAL") == 0)
+ return TRUE;
+ return FALSE;
+}
+
+/**
+ * bus_authorize_authenticated_peer_cb:
+ * @observer: A #GDBusAuthObserver.
+ * @stream: A #GIOStream.
+ * @credentials: A #GCredentials.
+ * @user_data: always %NULL.
+ *
+ * Check if a peer who has already authenticated should be authorized.
+ * Returns: %TRUE if the peer's credential is authorized.
+ */
+static gboolean
+bus_authorize_authenticated_peer_cb (GDBusAuthObserver *observer,
+ GIOStream *stream,
+ GCredentials *credentials,
+ G_GNUC_UNUSED gpointer user_data)
+{
+ gboolean authorized = FALSE;
+ if (credentials) {
+ GCredentials *own_credentials = g_credentials_new ();
+ if (g_credentials_is_same_user (credentials, own_credentials, NULL))
+ authorized = TRUE;
+ g_object_unref (own_credentials);
+ }
+ return authorized;
+}
+
+/**
* bus_new_connection_cb:
- * @user_data: always NULL.
- * @returns: TRUE when the function can handle the connection.
+ * @observer: A #GDBusAuthObserver.
+ * @dbus_connection: A #GDBusconnection.
+ * @user_data: always %NULL.
*
* Handle incoming connections.
+ * Returns: %TRUE when the function can handle the connection.
*/
static gboolean
-bus_new_connection_cb (GDBusServer *server,
- GDBusConnection *dbus_connection,
- gpointer user_data)
+bus_new_connection_cb (GDBusServer *server,
+ GDBusConnection *dbus_connection,
+ G_GNUC_UNUSED gpointer user_data)
{
BusConnection *connection = bus_connection_new (dbus_connection);
bus_dbus_impl_new_connection (dbus, connection);
@@ -94,9 +142,9 @@ bus_new_connection_cb (GDBusServer *
}
static void
-_server_connect_start_portal_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+_server_connect_start_portal_cb (GObject *source_object,
+ GAsyncResult *res,
+ G_GNUC_UNUSED gpointer user_data)
{
GVariant *result;
GError *error = NULL;
@@ -113,9 +161,9 @@ _server_connect_start_portal_cb (GObject
}
static void
-bus_acquired_handler (GDBusConnection *connection,
- const gchar *name,
- gpointer user_data)
+bus_acquired_handler (GDBusConnection *connection,
+ const gchar *name,
+ G_GNUC_UNUSED gpointer user_data)
{
g_dbus_connection_call (connection,
IBUS_SERVICE_PORTAL,
@@ -136,22 +184,27 @@ void
bus_server_init (void)
{
GError *error = NULL;
+ GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_NONE;
+ gchar *guid;
+ GDBusAuthObserver *observer;
dbus = bus_dbus_impl_get_default ();
ibus = bus_ibus_impl_get_default ();
bus_dbus_impl_register_object (dbus, (IBusService *)ibus);
/* init server */
- GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;
- gchar *guid = g_dbus_generate_guid ();
- if (!g_str_has_prefix (g_address, "unix:tmpdir=")) {
- g_error ("Your socket address does not have the format unix:tmpdir=$DIR; %s",
- g_address);
+ guid = g_dbus_generate_guid ();
+ observer = g_dbus_auth_observer_new ();
+ if (!g_str_has_prefix (g_address, "unix:tmpdir=") &&
+ !g_str_has_prefix (g_address, "unix:path=")) {
+ g_error ("Your socket address does not have the format unix:tmpdir=$DIR "
+ "or unix:path=$FILE; %s", g_address);
+
}
server = g_dbus_server_new_sync (
g_address, /* the place where the socket file lives, e.g. /tmp, abstract namespace, etc. */
flags, guid,
- NULL /* observer */,
+ observer,
NULL /* cancellable */,
&error);
if (server == NULL) {
@@ -161,7 +214,13 @@ bus_server_init (void)
}
g_free (guid);
- g_signal_connect (server, "new-connection", G_CALLBACK (bus_new_connection_cb), NULL);
+ g_signal_connect (observer, "allow-mechanism",
+ G_CALLBACK (bus_allow_mechanism_cb), NULL);
+ g_signal_connect (observer, "authorize-authenticated-peer",
+ G_CALLBACK (bus_authorize_authenticated_peer_cb), NULL);
+ g_object_unref (observer);
+ g_signal_connect (server, "new-connection",
+ G_CALLBACK (bus_new_connection_cb), NULL);
g_dbus_server_start (server);
--
2.21.0

View File

@ -0,0 +1,347 @@
From c38e925eba2b1f7af39696e2f64ec1eaea94b00b Mon Sep 17 00:00:00 2001
From: Takao Fujiwara <fujiwara@redhat.com>
Date: Thu, 30 Sep 2021 09:36:12 -0400
Subject: [PATCH] Backport IBus Unicode feature
---
configure.ac | 10 +++++++
ui/gtk3/Makefile.am | 5 +++-
ui/gtk3/emojier.vala | 37 +++++++++++++++--------
ui/gtk3/emojierapp.vala | 63 ++++++++++++++++++++++++++++-----------
ui/gtk3/panelbinding.vala | 13 ++++++--
5 files changed, 93 insertions(+), 35 deletions(-)
diff --git a/configure.ac b/configure.ac
index 46ab7a9..26bb357 100644
--- a/configure.ac
+++ b/configure.ac
@@ -237,12 +237,21 @@ if test x"$enable_gtk3" = x"yes"; then
PKG_CHECK_MODULES(GTK3, [
gtk+-3.0
])
+ PKG_CHECK_EXISTS([gdk-wayland-3.0],
+ [enable_gdk3_wayland=yes],
+ [enable_gdk3_wayland=no]
+ )
gtk3_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
GTK3_IM_MODULEDIR="$libdir"/gtk-3.0/$gtk3_binary_version/immodules
else
enable_gtk3="no (disabled, use --enable-gtk3 to enable)"
+ enable_gdk3_wayland=no
+fi
+if test x"$enable_gdk3_wayland" != x"yes"; then
+ enable_gdk3_wayland="no (disabled, need to install gdk-wayland-3.0.pc)"
fi
+AM_CONDITIONAL([ENABLE_GDK3_WAYLAND], [test x"$enable_gdk3_wayland" = x"yes"])
if test x"$enable_xim" = x"yes"; then
# Check for x11
@@ -796,6 +805,7 @@ Build options:
Build gtk3 immodule $enable_gtk3
Build XIM agent server $enable_xim
Build wayland support $enable_wayland
+ Build gdk3 wayland support $enable_gdk3_wayland
Build appindicator support $enable_appindicator
Build appindicator engine icon $enable_appindicator_engine_icon
Build python library $enable_python_library
diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
index aaba7a4..6ebc96c 100644
--- a/ui/gtk3/Makefile.am
+++ b/ui/gtk3/Makefile.am
@@ -78,7 +78,6 @@ AM_VALAFLAGS = \
--pkg=ibus-1.0 \
--pkg=config \
--pkg=xi \
- --pkg=gdk-wayland \
--target-glib="$(VALA_TARGET_GLIB_VERSION)" \
$(NULL)
@@ -105,6 +104,10 @@ if ENABLE_APPINDICATOR_ENGINE_ICON
AM_VALAFLAGS += --define=INDICATOR_ENGINE_ICON
endif
+if ENABLE_GDK3_WAYLAND
+AM_VALAFLAGS += --pkg=gdk-wayland --define=USE_GDK_WAYLAND
+endif
+
libexec_PROGRAMS = ibus-ui-gtk3
ibus_ui_gtk3_SOURCES = \
diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
index 3eac2f2..9e6e926 100644
--- a/ui/gtk3/emojier.vala
+++ b/ui/gtk3/emojier.vala
@@ -2,7 +2,7 @@
*
* ibus - The Input Bus
*
- * Copyright (c) 2017-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (c) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -320,6 +320,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
public signal void candidate_clicked(uint index, uint button, uint state);
public signal void commit_text(string text);
+ public signal void cancel();
public IBusEmojier() {
GLib.Object(
@@ -864,7 +865,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
row.get_allocation(out alloc);
var adjustment = m_scrolled_window.get_vadjustment();
adjustment.clamp_page(alloc.y, alloc.y + alloc.height);
- return_val_if_fail(m_category_active_index >= 0, false);
+ return_if_fail(m_category_active_index >= 0);
m_lookup_table.set_cursor_pos((uint)m_category_active_index);
}
@@ -936,8 +937,13 @@ public class IBusEmojier : Gtk.ApplicationWindow {
update_unicode_blocks();
return;
} else {
- unowned GLib.SList<unowned string> emojis =
- m_category_to_emojis_dict.lookup(category);
+ // Use copy_deep() since vala 0.43.4 does not allow to assign
+ // a weak pointer to the full one in SList:
+ // emojier.vala:885.48-886.62: error: Assignment: Cannot convert
+ // from `GLib.SList<string>' to `GLib.SList<weak string>?'
+ GLib.SList<string> emojis =
+ m_category_to_emojis_dict.lookup(category).copy_deep(
+ GLib.strdup);
m_lookup_table.clear();
m_candidate_panel_mode = true;
foreach (unowned string emoji in emojis) {
@@ -1601,8 +1607,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
m_vbox.add(widget);
widget.show_all();
}
- unowned GLib.SList<unowned string>? annotations =
- data.get_annotations();
+ GLib.SList<string> annotations =
+ data.get_annotations().copy_deep(GLib.strdup);
var buff = new GLib.StringBuilder();
int i = 0;
foreach (unowned string annotation in annotations) {
@@ -1784,8 +1790,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
show_emoji_variants(emojis);
return true;
}
- if (m_input_context_path != "")
- m_result = text;
+ m_result = text;
if (need_commit_signal)
commit_text(text);
return false;
@@ -1892,6 +1897,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
// PageUp/PageDown.
remove_all_children();
}
+ cancel();
return false;
}
@@ -2055,17 +2061,20 @@ public class IBusEmojier : Gtk.ApplicationWindow {
) as IBus.EmojiData;
m_emoji_to_data_dict.insert(favorite, new_data);
} else {
- unowned GLib.SList<string> annotations = data.get_annotations();
+ GLib.SList<string> annotations =
+ data.get_annotations().copy_deep(GLib.strdup);
if (annotations.find_custom(annotation, GLib.strcmp) == null) {
annotations.append(annotation);
- data.set_annotations(annotations.copy());
+ data.set_annotations(annotations.copy_deep(GLib.strdup));
}
}
unowned GLib.SList<string> emojis =
m_annotation_to_emojis_dict.lookup(annotation);
if (emojis.find_custom(favorite, GLib.strcmp) == null) {
emojis.append(favorite);
- m_annotation_to_emojis_dict.replace(annotation, emojis.copy());
+ m_annotation_to_emojis_dict.replace(
+ annotation,
+ emojis.copy_deep(GLib.strdup));
}
}
}
@@ -2117,7 +2126,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
public string get_current_candidate() {
// If category_list mode, do not show the category name on preedit.
// If candidate_panel mode, the first space key does not show the
- // lookup table but the first candidate is avaiable on preedit.
+ // lookup table but the first candidate is available on preedit.
if (!m_candidate_panel_mode)
return "";
uint cursor = m_lookup_table.get_cursor_pos();
@@ -2139,11 +2148,13 @@ public class IBusEmojier : Gtk.ApplicationWindow {
ncandidates));
int char_count = text.text.char_count();
int start_index = -1;
+ unowned string title = text.text;
for (int i = 0; i < char_count; i++) {
- if (text.text.utf8_offset(i).has_prefix(language)) {
+ if (title.has_prefix(language)) {
start_index = i;
break;
}
+ title = title.next_char();
}
if (start_index >= 0) {
var attr = new IBus.Attribute(
diff --git a/ui/gtk3/emojierapp.vala b/ui/gtk3/emojierapp.vala
index fab99d9..7bc7b42 100644
--- a/ui/gtk3/emojierapp.vala
+++ b/ui/gtk3/emojierapp.vala
@@ -3,6 +3,7 @@
* ibus - The Input Bus
*
* Copyright (c) 2017 Peng Wu <alexepico@gmail.com>
+ * Copyright (c) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -40,6 +41,33 @@ public class EmojiApplication : Gtk.Application {
}
+ private void save_selected_string(string? selected_string,
+ bool cancelled) {
+ if (cancelled) {
+ m_command_line.print("%s\n", _("Canceled to choose an emoji."));
+ return;
+ }
+ GLib.return_if_fail(selected_string != null);
+ Gtk.Clipboard clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD);
+ clipboard.set_text(selected_string, -1);
+ clipboard.store();
+
+ var emojier_favorites = m_settings_emoji.get_strv("favorites");
+ bool has_favorite = false;
+ foreach (unowned string favorite in emojier_favorites) {
+ if (favorite == selected_string) {
+ has_favorite = true;
+ break;
+ }
+ }
+ if (!has_favorite) {
+ emojier_favorites += selected_string;
+ m_settings_emoji.set_strv("favorites", emojier_favorites);
+ }
+ m_command_line.print("%s\n", _("Copied an emoji to your clipboard."));
+ }
+
+
private void show_dialog(ApplicationCommandLine command_line) {
m_command_line = command_line;
m_emojier.reset();
@@ -55,7 +83,7 @@ public class EmojiApplication : Gtk.Application {
return;
if (button == IBusEmojier.BUTTON_CLOSE_BUTTON) {
m_emojier.hide();
- m_command_line.print("%s\n", _("Canceled to choose an emoji."));
+ save_selected_string(null, true);
m_command_line = null;
return;
}
@@ -74,23 +102,7 @@ public class EmojiApplication : Gtk.Application {
}
string emoji = m_emojier.get_current_candidate();
m_emojier.hide();
- Gtk.Clipboard clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD);
- clipboard.set_text(emoji, -1);
- clipboard.store();
-
- var emojier_favorites = m_settings_emoji.get_strv("favorites");
- bool has_favorite = false;
- foreach (unowned string favorite in emojier_favorites) {
- if (favorite == emoji) {
- has_favorite = true;
- break;
- }
- }
- if (!has_favorite) {
- emojier_favorites += emoji;
- m_settings_emoji.set_strv("favorites", emojier_favorites);
- }
- m_command_line.print("%s\n", _("Copied an emoji to your clipboard."));
+ save_selected_string(emoji, false);
m_command_line = null;
}
@@ -202,6 +214,21 @@ public class EmojiApplication : Gtk.Application {
m_emojier.candidate_clicked.connect((i, b, s) => {
candidate_clicked_lookup_table(i, b, s);
});
+ m_emojier.cancel.connect(() => {
+ if (m_command_line == null)
+ return;
+ m_emojier.hide();
+ save_selected_string(null, true);
+ m_command_line = null;
+ });
+ m_emojier.commit_text.connect(() => {
+ if (m_command_line == null)
+ return;
+ m_emojier.hide();
+ string selected_string = m_emojier.get_selected_string();
+ save_selected_string(selected_string, false);
+ m_command_line = null;
+ });
}
activate_dialog(command_line);
diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
index cfedb2d..861255b 100644
--- a/ui/gtk3/panelbinding.vala
+++ b/ui/gtk3/panelbinding.vala
@@ -3,7 +3,7 @@
* ibus - The Input Bus
*
* Copyright(c) 2018 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright(c) 2018 Takao Fujwiara <takao.fujiwara1@gmail.com>
+ * Copyright(c) 2018-2020 Takao Fujwiara <takao.fujiwara1@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -190,7 +190,7 @@ class Preedit : Gtk.Window {
public IBus.Text get_commit_text() {
string extension_text = m_extension_preedit_emoji.get_text();
- if (extension_text.length == 0)
+ if (extension_text.length == 0 && m_prefix != "u")
extension_text = m_extension_preedit_text.get_text();
return new IBus.Text.from_string(extension_text);
}
@@ -237,9 +237,14 @@ class PanelBinding : IBus.PanelService {
GLib.Object(connection : bus.get_connection(),
object_path : IBus.PATH_PANEL_EXTENSION_EMOJI);
+#if USE_GDK_WAYLAND
Type instance_type = Gdk.Display.get_default().get_type();
Type wayland_type = typeof(GdkWayland.Display);
m_is_wayland = instance_type.is_a(wayland_type);
+#else
+ m_is_wayland = false;
+ warning("Checking Wayland is disabled");
+#endif
m_bus = bus;
m_application = application;
@@ -551,8 +556,10 @@ class PanelBinding : IBus.PanelService {
private bool key_press_keyval(uint keyval) {
unichar ch = IBus.keyval_to_unicode(keyval);
+ if (m_extension_name == "unicode" && !ch.isxdigit())
+ return false;
if (ch.iscntrl())
- return false;
+ return false;
string str = ch.to_string();
m_preedit.append_text(str);
string annotation = m_preedit.get_text();
--
2.27.0

View File

@ -0,0 +1,26 @@
From 6aab10f2e5a8e10dac9b007eff19b26990461790 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 14 Feb 2019 17:37:39 +0900
Subject: [PATCH] ui/gtk3: Fix assert with 16 candidates
BUG=https://github.com/ibus/ibus/issues/2076
---
ui/gtk3/candidatearea.vala | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/gtk3/candidatearea.vala b/ui/gtk3/candidatearea.vala
index f590cf3a..781ecd1e 100644
--- a/ui/gtk3/candidatearea.vala
+++ b/ui/gtk3/candidatearea.vala
@@ -109,7 +109,7 @@ class CandidateArea : Gtk.Box {
m_focus_candidate = focus_candidate;
m_show_cursor = show_cursor;
- assert(candidates.length < 16);
+ assert(candidates.length <= 16);
for (int i = 0 ; i < 16 ; i++) {
Gtk.Label label = m_candidates[i];
bool visible = false;
--
2.21.0

View File

@ -0,0 +1,134 @@
From 8375f391e1b9bfc048ff14fd458f689d853064ac Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 28 Feb 2019 15:26:11 +0900
Subject: [PATCH] ui/gtk3: Do not add emojis in compose category to emoji
variants
Any emojis in compose category have variants and should be shown by default.
---
bindings/vala/IBus-1.0-custom.vala | 4 ++
ui/gtk3/emojier.vala | 74 ++++++++++++++++++++++++++----
2 files changed, 68 insertions(+), 10 deletions(-)
diff --git a/bindings/vala/IBus-1.0-custom.vala b/bindings/vala/IBus-1.0-custom.vala
index 7d34a8bd..ec46fc90 100644
--- a/bindings/vala/IBus-1.0-custom.vala
+++ b/bindings/vala/IBus-1.0-custom.vala
@@ -17,4 +17,8 @@ namespace IBus {
public class PanelService : IBus.Service {
public void panel_extension_register_keys(string first_property_name, ...);
}
+ public class EmojiData : IBus.Serializable {
+ [CCode (cname = "ibus_emoji_data_new", has_construct_function = true)]
+ public EmojiData (string first_property_name, ...);
+ }
}
diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
index aedeb4cb..fc15cffe 100644
--- a/ui/gtk3/emojier.vala
+++ b/ui/gtk3/emojier.vala
@@ -389,6 +389,14 @@ public class IBusEmojier : Gtk.ApplicationWindow {
}
make_emoji_dict(m_current_lang_id);
}
+ add_variants_to_component();
+
+ GLib.List<unowned string> annotations =
+ m_annotation_to_emojis_dict.get_keys();
+ foreach (unowned string annotation in annotations) {
+ if (m_emoji_max_seq_len < annotation.length)
+ m_emoji_max_seq_len = annotation.length;
+ }
update_favorite_emoji_dict();
}
@@ -430,11 +438,54 @@ public class IBusEmojier : Gtk.ApplicationWindow {
update_annotation_to_emojis_dict(data);
update_category_to_emojis_dict(data, lang);
}
- GLib.List<unowned string> annotations =
- m_annotation_to_emojis_dict.get_keys();
- foreach (unowned string annotation in annotations) {
- if (m_emoji_max_seq_len < annotation.length)
- m_emoji_max_seq_len = annotation.length;
+ }
+
+
+ private static void add_variants_to_component() {
+ string category = "Component";
+ unowned GLib.SList<string> hits =
+ m_category_to_emojis_dict.lookup(category);
+ if (hits == null) {
+ category = "component";
+ hits = m_category_to_emojis_dict.lookup(category);
+ }
+ if (hits == null)
+ return;
+ GLib.SList<IBus.EmojiData> emoji_list =
+ new GLib.SList<IBus.EmojiData>();
+ GLib.SList<string> annotations = new GLib.SList<string>();
+ annotations.append("zero");
+ IBus.EmojiData _data;
+ _data = new IBus.EmojiData("emoji", "\u200d",
+ "annotations", annotations,
+ "description",
+ "ZERO WIDTH JOINER",
+ "category", category);
+ emoji_list.append(_data);
+ annotations = null;
+ annotations.append("text");
+ annotations.append("variation");
+ annotations.append("selector");
+ _data = new IBus.EmojiData("emoji", "\ufe0e",
+ "annotations", annotations,
+ "description",
+ "VARIATION SELECTOR-15",
+ "category", category);
+ emoji_list.append(_data);
+ annotations = null;
+ annotations.append("emoji");
+ annotations.append("variation");
+ annotations.append("selector");
+ _data = new IBus.EmojiData("emoji", "\ufe0f",
+ "annotations", annotations,
+ "description",
+ "VARIATION SELECTOR-16",
+ "category", category);
+ emoji_list.append(_data);
+ foreach (IBus.EmojiData data in emoji_list) {
+ update_emoji_to_data_dict(data, "en");
+ update_annotation_to_emojis_dict(data);
+ update_category_to_emojis_dict(data, "en");
}
}
@@ -583,10 +634,12 @@ public class IBusEmojier : Gtk.ApplicationWindow {
category = EMOJI_CATEGORY_OTHERS;
if (lang == "en") {
bool has_variant = false;
- foreach (unichar ch in EMOJI_VARIANT_LIST) {
- if (emoji.index_of_char(ch) >= 0) {
- has_variant = true;
- break;
+ if (category.ascii_casecmp("component") != 0) {
+ foreach (unichar ch in EMOJI_VARIANT_LIST) {
+ if (emoji.index_of_char(ch) >= 0) {
+ has_variant = true;
+ break;
+ }
}
}
// If emoji includes variants (skin colors and items),
@@ -606,7 +659,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
if (variants.find_custom(emoji, GLib.strcmp) == null) {
if (variants == null)
variants.append(base_emoji);
- variants.append(emoji);
+ if (base_emoji != emoji)
+ variants.append(emoji);
m_emoji_to_emoji_variants_dict.replace(
base_emoji,
variants.copy_deep(GLib.strdup));
--
2.21.0

View File

@ -0,0 +1,60 @@
From 1cb5032e85d85f496e349236d1b74f17fb8db966 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Tue, 23 Apr 2019 15:40:45 +0900
Subject: [PATCH] configure: Move ibus-setup from configure.ac to Makefile.am
@localedir@ can be extracted to ${datarootdir}/locale and
it needs datarootdir=/usr/share in case configure.ac is used
and deleting the datarootdir line caused a regression.
All variables can be extracted in Makefile.am with sed.
---
configure.ac | 1 -
setup/Makefile.am | 13 +++++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9518e808..7503f3e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -724,7 +724,6 @@ ibus/interface/Makefile
ui/Makefile
ui/gtk3/Makefile
setup/Makefile
-setup/ibus-setup
bindings/Makefile
bindings/pygobject/Makefile
bindings/vala/Makefile
diff --git a/setup/Makefile.am b/setup/Makefile.am
index cb4dd8d1..34c8f136 100644
--- a/setup/Makefile.am
+++ b/setup/Makefile.am
@@ -3,8 +3,8 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2014 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2017 Red Hat, Inc.
+# Copyright (c) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2019 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -40,6 +40,15 @@ ibussetup_DATA = \
bin_SCRIPTS = ibus-setup
ibussetupdir = $(pkgdatadir)/setup
+ibus-setup: ibus-setup.in
+ $(AM_V_GEN) sed -e "s|\@datarootdir\@|$(datarootdir)|g" \
+ -e "s|\@localedir\@|$(localedir)|g" \
+ -e "s|\@libexecdir\@|$(libexecdir)|g" \
+ -e "s|\@prefix\@|$(prefix)|g" \
+ -e "s|\@PYTHON\@|$(PYTHON)|g" \
+ $< > $@.tmp && \
+ mv $@.tmp $@
+
desktop_in_files = ibus-setup.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
desktopdir = $(datadir)/applications
--
2.21.0

View File

@ -31,7 +31,7 @@
Name: ibus
Version: 1.5.19
Release: 4%{?dist}
Release: 14%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
@ -39,11 +39,29 @@ URL: https://github.com/ibus/%name/wiki
Source0: https://github.com/ibus/%name/releases/download/%{version}/%{name}-%{version}.tar.gz
Source1: %{name}-xinput
Source2: %{name}.conf.5
Source3: https://fujiwara.fedorapeople.org/ibus/po/%{name}-po-1.5.19-20180822.tar.gz
Source3: https://fujiwara.fedorapeople.org/ibus/po/%{name}-po-1.5.19-20210706.tar.gz
# Patch0: %%{name}-HEAD.patch
# RHEL 8.0 From upstreamed patches
Patch0: %{name}-HEAD.patch
# Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577
Patch1: %{name}-1385349-segv-bus-proxy.patch
# RHEL 8.2 Fix not to assert with wrong compose files
Patch1: %{name}-1470673-emoji-warn-instead-assert.patch
# RHEL 8.2 Fix not to assert with 16 candidates
Patch2: %{name}-2076-fix-16-candidates.patch
# RHEL 8.2 Show emoji compose in the top category
Patch3: %{name}-xx-emoji-compose.patch
# RHEL 8.2 Extract $(datarootdir) in ibus-setup
Patch4: %{name}-xx-setup-env.patch
# RHEL 8.2 CVE 2019-14822
Patch5: %{name}-1750836-server-auth-observer.patch
# RHEL 8.2 Bug 1682157 - Integrate ibus-desktop-testing and test cases
Patch6: %{name}-1682157-ci.patch
# RHEL 8.2 Bug 1713606 - Fix hangul preedit commit with mouse click
Patch7: %{name}-1713606-hangul-with-mouse.patch
# RHEL 8.5 Bug 1897548 - Enable to lookup Unicode names
Patch8: %{name}-1897548-emoji-unicode.patch
# RHEL 8.0 Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577
Patch100: %{name}-1385349-segv-bus-proxy.patch
BuildRequires: gettext-devel
BuildRequires: libtool
@ -52,16 +70,19 @@ BuildRequires: glib2-doc
BuildRequires: gtk2-devel
BuildRequires: gtk3-devel
BuildRequires: dbus-glib-devel
BuildRequires: dbus-python-devel >= %{dbus_python_version}
BuildRequires: desktop-file-utils
BuildRequires: gtk-doc
BuildRequires: dconf-devel
BuildRequires: dbus-x11
BuildRequires: python3-devel
BuildRequires: python3-gobject
%if %with_python2
# http://pkgs.devel.redhat.com/cgit/rpms/GConf2/commit/?h=rhel-8.3.0&id=82fe51c3
# https://bugzilla.gnome.org/show_bug.cgi?id=759334
# Need python2 for gsettings-schema-convert
BuildRequires: python2-devel
BuildRequires: dbus-python-devel >= %{dbus_python_version}
%endif
BuildRequires: vala
BuildRequires: vala-devel
BuildRequires: vala-tools
@ -236,19 +257,54 @@ BuildArch: noarch
%description devel-docs
The ibus-devel-docs package contains developer documentation for IBus
%package desktop-testing
Summary: Wrapper of InstalledTests Runner for IBus
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description desktop-testing
GNOME desktop testing runner implements the InstalledTests specification
and IBus also needs focus events to enable input contexts on text widgets.
The wrapper script runs gnome-session for the focus events and GNOME
desktop testing runner internally.
%package tests
Summary: Tests for the %{name} package
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description tests
The %{name}-tests package contains tests that can be used to verify
the functionality of the installed %{name} package.
%prep
%autosetup -S git
# cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || :
cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || :
zcat %SOURCE3 | tar xfv -
cp /usr/share/unicode/ucd/Blocks.txt .
NL=/usr/share/unicode/ucd/NamesList.txt
sed -e '/^@@.*3300.*CJK Compatibility/i\
@ Japanese era name\
32FF SQUARE ERA NAME REIWA\
# <square> 4EE4 548C' $NL > NamesList.txt
diff $NL NamesList.txt || :
# prep test
diff client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c
if test $? -ne 0 ; then
echo "Have to copy ibusimcontext.c into client/gtk3"
abort
fi
for f in ibusimcontext.c ibusim.c
do
diff client/gtk2/$f client/gtk3/$f
if test $? -ne 0 ; then
echo "Have to copy $f into client/gtk3"
abort
fi
done
%build
#autoreconf -f -i -v
@ -273,11 +329,16 @@ autoreconf -f -i -v
--disable-appindicator \
%endif
--enable-introspection \
--enable-install-tests \
--with-ucd-dir=$PWD \
%{nil}
make -C ui/gtk3 maintainer-clean-generic
make %{?_smp_mflags}
env PAGER=: git diff src/ibusemojigen.h
env PAGER=: git diff src/ibusunicodegen.h
%install
make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p'
rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-*%{ibus_api_version}.la
@ -300,6 +361,12 @@ install -pm 644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_xinputconf}
echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop
#echo "X-GNOME-Autostart-enabled=false" >> $RPM_BUILD_ROOT%%{_sysconfdir}/xdg/autostart/ibus.desktop
# Delete unused prefix line in Fedora only
if test `grep '^prefix' $RPM_BUILD_ROOT%{_bindir}/ibus-setup | wc -l` = 1 ; then
sed -i -e '/^prefix/d' $RPM_BUILD_ROOT%{_bindir}/ibus-setup
fi
desktop-file-install --delete-original \
--dir $RPM_BUILD_ROOT%{_datadir}/applications \
$RPM_BUILD_ROOT%{_datadir}/applications/*
@ -424,7 +491,52 @@ dconf update || :
%dir %{_datadir}/gtk-doc/html
%{_datadir}/gtk-doc/html/*
%files desktop-testing
%{_bindir}/ibus-desktop-testing-runner
%files tests
%dir %{_libexecdir}/installed-tests
%{_libexecdir}/installed-tests/ibus
%dir %{_datadir}/installed-tests
%{_datadir}/installed-tests/ibus
%changelog
* Mon Oct 18 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-14
- Resolves: #2014064 - Fix regression of Emoji typing in Wayland
* Tue Jul 06 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-13
- Resolves: #1897548 - Rebuild IBus emoji with unicode-emoji-13.0-4 and cldr-emoji-annotation-39-2
- Rebuild ibusemojigen.h and ibusunicodegen.h
- Add ibus-1897548-emoji-unicode.patch to lookup Unicode names
- Add U+32FF to IBusUnicodeData
- Add ibus-po-1.5.19-20210706.tar.gz
* Thu Jun 04 2020 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-12
- Resolves: #1713606 - Fix hangul preedit commit with mouse click
- Update 1682157-ci.patch
* Thu Jan 09 2020 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-11
- Resolves: #1750836 - Fix CVE-2019-14822
* Thu Dec 12 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-10
- Resolves: #1750836 - Revert Hangul fix for 8.2 schedule
* Tue Dec 03 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-9
- Resolves: #1682157 - Fix RHEL 8.2 covscan #2
* Sat Nov 30 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-8
- Resolves: #1682157 - Fix libibus dependency in ibus-tests with rpmdiff
* Fri Nov 29 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-7
- Resolves: #1682157 - Fix RHEL 8.2 covscan
* Fri Nov 29 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-6
- Resolves: #1682157 - Add CI
* Fri Nov 29 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-5
- Resolves: #1713606 - Fix hangul preedit commit with mouse click
- Resolves: #1682157 - Integrate ibus-desktop-testing and test cases
* Tue Nov 06 2018 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.19-4
- Delete Requires ibus in ibus-gtk* for Flatpak
- Update upstreamed patches