import ibus-1.5.19-4.el8
This commit is contained in:
commit
14499b7697
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
SOURCES/ibus-1.5.19.tar.gz
|
||||||
|
SOURCES/ibus-po-1.5.19-20180822.tar.gz
|
2
.ibus.metadata
Normal file
2
.ibus.metadata
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fdda025d81247e40ad7acf953c2a0a606d18e965 SOURCES/ibus-1.5.19.tar.gz
|
||||||
|
36b017eddba8bc0dd970acaa2cab41d0053d6c9f SOURCES/ibus-po-1.5.19-20180822.tar.gz
|
214
SOURCES/ibus-1385349-segv-bus-proxy.patch
Normal file
214
SOURCES/ibus-1385349-segv-bus-proxy.patch
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
From 865b204f1c06b782cf7b4a479b358e76f4b3dfee Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Tue, 17 Jul 2018 13:39:30 +0900
|
||||||
|
Subject: [PATCH] bus: Fix SEGV in bus_panel_proxy_focus_in()
|
||||||
|
|
||||||
|
BUG=rhbz#1349148
|
||||||
|
BUG=rhbz#1385349
|
||||||
|
BUG=rhbz#1350291
|
||||||
|
BUG=rhbz#1406699
|
||||||
|
BUG=rhbz#1432252
|
||||||
|
BUG=rhbz#1601577
|
||||||
|
---
|
||||||
|
bus/dbusimpl.c | 38 ++++++++++++++++++++++++++++++++------
|
||||||
|
bus/engineproxy.c | 5 ++++-
|
||||||
|
bus/ibusimpl.c | 21 ++++++++++++++++++---
|
||||||
|
3 files changed, 54 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c
|
||||||
|
index b54ef817..e4dd8683 100644
|
||||||
|
--- a/bus/dbusimpl.c
|
||||||
|
+++ b/bus/dbusimpl.c
|
||||||
|
@@ -2,7 +2,8 @@
|
||||||
|
/* vim:set et sts=4: */
|
||||||
|
/* ibus - The Input Bus
|
||||||
|
* Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
|
||||||
|
- * Copyright (C) 2008-2013 Red Hat, Inc.
|
||||||
|
+ * Copyright (C) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
|
||||||
|
+ * Copyright (C) 2008-2017 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
|
||||||
|
@@ -344,6 +345,8 @@ bus_name_service_set_primary_owner (BusNameService *service,
|
||||||
|
BusConnectionOwner *owner,
|
||||||
|
BusDBusImpl *dbus)
|
||||||
|
{
|
||||||
|
+ gboolean has_old_owner = FALSE;
|
||||||
|
+
|
||||||
|
g_assert (service != NULL);
|
||||||
|
g_assert (owner != NULL);
|
||||||
|
g_assert (dbus != NULL);
|
||||||
|
@@ -351,6 +354,13 @@ bus_name_service_set_primary_owner (BusNameService *service,
|
||||||
|
BusConnectionOwner *old = service->owners != NULL ?
|
||||||
|
(BusConnectionOwner *)service->owners->data : NULL;
|
||||||
|
|
||||||
|
+ /* rhbz#1432252 If bus_connection_get_unique_name() == NULL,
|
||||||
|
+ * "Hello" method is not received yet.
|
||||||
|
+ */
|
||||||
|
+ if (old != NULL && bus_connection_get_unique_name (old->conn) != NULL) {
|
||||||
|
+ has_old_owner = TRUE;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (old != NULL) {
|
||||||
|
g_signal_emit (dbus,
|
||||||
|
dbus_signals[NAME_LOST],
|
||||||
|
@@ -370,7 +380,8 @@ bus_name_service_set_primary_owner (BusNameService *service,
|
||||||
|
0,
|
||||||
|
owner->conn,
|
||||||
|
service->name,
|
||||||
|
- old != NULL ? bus_connection_get_unique_name (old->conn) : "",
|
||||||
|
+ has_old_owner ? bus_connection_get_unique_name (old->conn) :
|
||||||
|
+ "",
|
||||||
|
bus_connection_get_unique_name (owner->conn));
|
||||||
|
|
||||||
|
if (old != NULL && old->do_not_queue != 0) {
|
||||||
|
@@ -427,6 +438,7 @@ bus_name_service_remove_owner (BusNameService *service,
|
||||||
|
BusDBusImpl *dbus)
|
||||||
|
{
|
||||||
|
GSList *owners;
|
||||||
|
+ gboolean has_new_owner = FALSE;
|
||||||
|
|
||||||
|
g_assert (service != NULL);
|
||||||
|
g_assert (owner != NULL);
|
||||||
|
@@ -439,6 +451,13 @@ bus_name_service_remove_owner (BusNameService *service,
|
||||||
|
BusConnectionOwner *_new = NULL;
|
||||||
|
if (owners->next != NULL) {
|
||||||
|
_new = (BusConnectionOwner *)owners->next->data;
|
||||||
|
+ /* rhbz#1406699 If bus_connection_get_unique_name() == NULL,
|
||||||
|
+ * "Hello" method is not received yet.
|
||||||
|
+ */
|
||||||
|
+ if (_new != NULL &&
|
||||||
|
+ bus_connection_get_unique_name (_new->conn) != NULL) {
|
||||||
|
+ has_new_owner = TRUE;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dbus != NULL) {
|
||||||
|
@@ -447,7 +466,7 @@ bus_name_service_remove_owner (BusNameService *service,
|
||||||
|
0,
|
||||||
|
owner->conn,
|
||||||
|
service->name);
|
||||||
|
- if (_new != NULL) {
|
||||||
|
+ if (has_new_owner) {
|
||||||
|
g_signal_emit (dbus,
|
||||||
|
dbus_signals[NAME_ACQUIRED],
|
||||||
|
0,
|
||||||
|
@@ -460,7 +479,7 @@ bus_name_service_remove_owner (BusNameService *service,
|
||||||
|
_new != NULL ? _new->conn : NULL,
|
||||||
|
service->name,
|
||||||
|
bus_connection_get_unique_name (owner->conn),
|
||||||
|
- _new != NULL ? bus_connection_get_unique_name (_new->conn) : "");
|
||||||
|
+ has_new_owner ? bus_connection_get_unique_name (_new->conn) : "");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1464,13 +1483,20 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
|
||||||
|
gboolean incoming,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
+ BusDBusImpl *dbus;
|
||||||
|
+ BusConnection *connection;
|
||||||
|
+
|
||||||
|
g_assert (G_IS_DBUS_CONNECTION (dbus_connection));
|
||||||
|
g_assert (G_IS_DBUS_MESSAGE (message));
|
||||||
|
g_assert (BUS_IS_DBUS_IMPL (user_data));
|
||||||
|
|
||||||
|
- BusDBusImpl *dbus = (BusDBusImpl *) user_data;
|
||||||
|
- BusConnection *connection = bus_connection_lookup (dbus_connection);
|
||||||
|
+ if (g_dbus_connection_is_closed (dbus_connection))
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
+ dbus = (BusDBusImpl *) user_data;
|
||||||
|
+ connection = bus_connection_lookup (dbus_connection);
|
||||||
|
g_assert (connection != NULL);
|
||||||
|
+ g_assert (BUS_IS_CONNECTION (connection));
|
||||||
|
|
||||||
|
if (incoming) {
|
||||||
|
/* is incoming message */
|
||||||
|
diff --git a/bus/engineproxy.c b/bus/engineproxy.c
|
||||||
|
index 2d98995c..d661673a 100644
|
||||||
|
--- a/bus/engineproxy.c
|
||||||
|
+++ b/bus/engineproxy.c
|
||||||
|
@@ -665,6 +665,7 @@ bus_engine_proxy_new_internal (const gchar *path,
|
||||||
|
IBusEngineDesc *desc,
|
||||||
|
GDBusConnection *connection)
|
||||||
|
{
|
||||||
|
+ GError *error = NULL;
|
||||||
|
g_assert (path);
|
||||||
|
g_assert (IBUS_IS_ENGINE_DESC (desc));
|
||||||
|
g_assert (G_IS_DBUS_CONNECTION (connection));
|
||||||
|
@@ -673,7 +674,7 @@ bus_engine_proxy_new_internal (const gchar *path,
|
||||||
|
BusEngineProxy *engine =
|
||||||
|
(BusEngineProxy *) g_initable_new (BUS_TYPE_ENGINE_PROXY,
|
||||||
|
NULL,
|
||||||
|
- NULL,
|
||||||
|
+ &error,
|
||||||
|
"desc", desc,
|
||||||
|
"g-connection", connection,
|
||||||
|
"g-interface-name", IBUS_INTERFACE_ENGINE,
|
||||||
|
@@ -681,6 +682,8 @@ bus_engine_proxy_new_internal (const gchar *path,
|
||||||
|
"g-default-timeout", g_gdbus_timeout,
|
||||||
|
"g-flags", flags,
|
||||||
|
NULL);
|
||||||
|
+ /* FIXME: rhbz#1601577 */
|
||||||
|
+ g_assert_no_error (error);
|
||||||
|
const gchar *layout = ibus_engine_desc_get_layout (desc);
|
||||||
|
if (layout != NULL && layout[0] != '\0') {
|
||||||
|
engine->keymap = ibus_keymap_get (layout);
|
||||||
|
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
|
||||||
|
index ec1caea8..9ae3751b 100644
|
||||||
|
--- a/bus/ibusimpl.c
|
||||||
|
+++ b/bus/ibusimpl.c
|
||||||
|
@@ -484,13 +484,16 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
|
||||||
|
else if (!g_strcmp0 (name, IBUS_SERVICE_PANEL_EXTENSION_EMOJI))
|
||||||
|
panel_type = PANEL_TYPE_EXTENSION_EMOJI;
|
||||||
|
|
||||||
|
- if (panel_type != PANEL_TYPE_NONE) {
|
||||||
|
+ do {
|
||||||
|
+ if (panel_type == PANEL_TYPE_NONE)
|
||||||
|
+ break;
|
||||||
|
if (g_strcmp0 (new_name, "") != 0) {
|
||||||
|
/* a Panel process is started. */
|
||||||
|
BusConnection *connection;
|
||||||
|
BusInputContext *context = NULL;
|
||||||
|
BusPanelProxy **panel = (panel_type == PANEL_TYPE_PANEL) ?
|
||||||
|
&ibus->panel : &ibus->emoji_extension;
|
||||||
|
+ GDBusConnection *dbus_connection = NULL;
|
||||||
|
|
||||||
|
if (*panel != NULL) {
|
||||||
|
ibus_proxy_destroy ((IBusProxy *)(*panel));
|
||||||
|
@@ -499,9 +502,21 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
|
||||||
|
g_assert (*panel == NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
- connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, new_name);
|
||||||
|
+ connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS,
|
||||||
|
+ new_name);
|
||||||
|
g_return_if_fail (connection != NULL);
|
||||||
|
|
||||||
|
+ dbus_connection = bus_connection_get_dbus_connection (connection);
|
||||||
|
+ /* rhbz#1349148 rhbz#1385349
|
||||||
|
+ * Avoid SEGV of BUS_IS_PANEL_PROXY (ibus->panel)
|
||||||
|
+ * This function is called during destroying the connection
|
||||||
|
+ * in this case? */
|
||||||
|
+ if (dbus_connection == NULL ||
|
||||||
|
+ g_dbus_connection_is_closed (dbus_connection)) {
|
||||||
|
+ new_name = "";
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
*panel = bus_panel_proxy_new (connection, panel_type);
|
||||||
|
if (panel_type == PANEL_TYPE_EXTENSION_EMOJI)
|
||||||
|
ibus->enable_emoji_extension = FALSE;
|
||||||
|
@@ -555,7 +570,7 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- }
|
||||||
|
+ } while (0);
|
||||||
|
|
||||||
|
bus_ibus_impl_component_name_owner_changed (ibus, name, old_name, new_name);
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
920
SOURCES/ibus-HEAD.patch
Normal file
920
SOURCES/ibus-HEAD.patch
Normal file
@ -0,0 +1,920 @@
|
|||||||
|
From 7edaefdc1d80aefdbbc2dc52526c20715759da83 Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Wed, 22 Aug 2018 17:20:53 +0900
|
||||||
|
Subject: [PATCH] ui/gtk3: Do not clear unicode data when emoji annotation lang
|
||||||
|
is changed
|
||||||
|
|
||||||
|
---
|
||||||
|
ui/gtk3/emojier.vala | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
|
||||||
|
index 85dcdceb..637ae049 100644
|
||||||
|
--- a/ui/gtk3/emojier.vala
|
||||||
|
+++ b/ui/gtk3/emojier.vala
|
||||||
|
@@ -440,13 +440,17 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
m_emoji_to_emoji_variants_dict =
|
||||||
|
new GLib.HashTable<string, GLib.SList<string>>(GLib.str_hash,
|
||||||
|
GLib.str_equal);
|
||||||
|
- m_unicode_to_data_dict =
|
||||||
|
+ if (m_unicode_to_data_dict == null) {
|
||||||
|
+ m_unicode_to_data_dict =
|
||||||
|
new GLib.HashTable<unichar, IBus.UnicodeData>(
|
||||||
|
GLib.direct_hash,
|
||||||
|
GLib.direct_equal);
|
||||||
|
- m_name_to_unicodes_dict =
|
||||||
|
+ }
|
||||||
|
+ if (m_name_to_unicodes_dict == null) {
|
||||||
|
+ m_name_to_unicodes_dict =
|
||||||
|
new GLib.HashTable<string, GLib.SList<unichar>>(GLib.str_hash,
|
||||||
|
GLib.str_equal);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
||||||
|
From 28d22176aee6be97d88dd6c60fa5395c79563ec0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Thu, 30 Aug 2018 12:57:33 +0900
|
||||||
|
Subject: [PATCH] ui/gtk3: Fix SEGV when type ASCII on emojier
|
||||||
|
|
||||||
|
Emojier still included Gtk.Entry, accepted key events in Wayland,
|
||||||
|
reset the lookup table and it caused SEGV because IBus.Text
|
||||||
|
is NULL in the lookup table in Emojier.get_current_candidate().
|
||||||
|
Now Gtk.Entry is deleted completely.
|
||||||
|
|
||||||
|
BUG=rhbz#1618682
|
||||||
|
---
|
||||||
|
ui/gtk3/emojier.vala | 139 +------------------------------------------
|
||||||
|
1 file changed, 1 insertion(+), 138 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
|
||||||
|
index 637ae049..0f455800 100644
|
||||||
|
--- a/ui/gtk3/emojier.vala
|
||||||
|
+++ b/ui/gtk3/emojier.vala
|
||||||
|
@@ -283,7 +283,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
|
||||||
|
private ThemedRGBA m_rgba;
|
||||||
|
private Gtk.Box m_vbox;
|
||||||
|
- private EEntry m_entry;
|
||||||
|
/* If emojier is emoji category list or Unicode category list,
|
||||||
|
* m_annotation is "" and preedit is also "".
|
||||||
|
* If emojier is candidate mode, m_annotation is an annotation and
|
||||||
|
@@ -367,23 +366,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
m_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
|
||||||
|
add(m_vbox);
|
||||||
|
|
||||||
|
- m_entry = new EEntry();
|
||||||
|
- m_entry.set_placeholder_text(_("Type annotation or choose emoji"));
|
||||||
|
- //m_vbox.add(m_entry);
|
||||||
|
- m_entry.changed.connect(() => {
|
||||||
|
- update_candidate_window();
|
||||||
|
- });
|
||||||
|
- m_entry.icon_release.connect((icon_pos, event) => {
|
||||||
|
- hide_candidate_panel();
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
- /* Set the accessible role of the label to a status bar so it
|
||||||
|
- * will emit name changed events that can be used by screen
|
||||||
|
- * readers.
|
||||||
|
- */
|
||||||
|
- Atk.Object obj = m_entry.get_accessible();
|
||||||
|
- obj.set_role (Atk.Role.STATUSBAR);
|
||||||
|
-
|
||||||
|
// The constructor of IBus.LookupTable does not support more than
|
||||||
|
// 16 pages.
|
||||||
|
m_lookup_table = new IBus.LookupTable(1, 0, true, true);
|
||||||
|
@@ -1806,18 +1788,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
m_lookup_table.cursor_up();
|
||||||
|
else if (keyval == Gdk.Key.Right)
|
||||||
|
m_lookup_table.cursor_down();
|
||||||
|
- } else if (m_entry.get_text().length > 0) {
|
||||||
|
- int step = 0;
|
||||||
|
- if (keyval == Gdk.Key.Left)
|
||||||
|
- step = -1;
|
||||||
|
- else if (keyval == Gdk.Key.Right)
|
||||||
|
- step = 1;
|
||||||
|
- GLib.Signal.emit_by_name(
|
||||||
|
- m_entry, "move-cursor",
|
||||||
|
- Gtk.MovementStep.VISUAL_POSITIONS,
|
||||||
|
- step,
|
||||||
|
- (modifiers & Gdk.ModifierType.SHIFT_MASK) != 0
|
||||||
|
- ? true : false);
|
||||||
|
} else {
|
||||||
|
// For Gdk.Key.f and Gdk.Key.b
|
||||||
|
if (keyval == Gdk.Key.Left)
|
||||||
|
@@ -1880,20 +1850,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
- if (m_entry.get_text().length > 0) {
|
||||||
|
- int step = 0;
|
||||||
|
- if (keyval == Gdk.Key.Home)
|
||||||
|
- step = -1;
|
||||||
|
- else if (keyval == Gdk.Key.End)
|
||||||
|
- step = 1;
|
||||||
|
- GLib.Signal.emit_by_name(
|
||||||
|
- m_entry, "move-cursor",
|
||||||
|
- Gtk.MovementStep.DISPLAY_LINE_ENDS,
|
||||||
|
- step,
|
||||||
|
- (modifiers & Gdk.ModifierType.SHIFT_MASK) != 0
|
||||||
|
- ? true : false);
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
return category_list_cursor_move(keyval);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1941,28 +1897,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- private void entry_enter_keyval(uint keyval) {
|
||||||
|
- unichar ch = IBus.keyval_to_unicode(keyval);
|
||||||
|
- if (ch.iscntrl())
|
||||||
|
- return;
|
||||||
|
- string str = ch.to_string();
|
||||||
|
-
|
||||||
|
- // what gtk_entry_commit_cb() do
|
||||||
|
- if (m_entry.get_selection_bounds(null, null)) {
|
||||||
|
- m_entry.delete_selection();
|
||||||
|
- } else {
|
||||||
|
- if (m_entry.get_overwrite_mode()) {
|
||||||
|
- uint text_length = m_entry.get_buffer().get_length();
|
||||||
|
- if (m_entry.cursor_position < text_length)
|
||||||
|
- m_entry.delete_from_cursor(Gtk.DeleteType.CHARS, 1);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- int pos = m_entry.get_position();
|
||||||
|
- m_entry.insert_text(str, -1, ref pos);
|
||||||
|
- m_entry.set_position(pos);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-
|
||||||
|
private Gdk.Rectangle get_monitor_geometry() {
|
||||||
|
Gdk.Rectangle monitor_area = { 0, };
|
||||||
|
|
||||||
|
@@ -2245,10 +2179,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
/* Let gtk recalculate the window size. */
|
||||||
|
resize(1, 1);
|
||||||
|
|
||||||
|
- m_entry.set_text("");
|
||||||
|
-
|
||||||
|
show_category_list();
|
||||||
|
- m_entry.set_activates_default(true);
|
||||||
|
show_all();
|
||||||
|
|
||||||
|
/* Some window managers, e.g. MATE, GNOME, Plasma desktops,
|
||||||
|
@@ -2289,13 +2220,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
m_loop.run();
|
||||||
|
m_loop = null;
|
||||||
|
|
||||||
|
- // Need focus-out on Gtk.Entry to send the emoji to applications.
|
||||||
|
- Gdk.Event fevent = new Gdk.Event(Gdk.EventType.FOCUS_CHANGE);
|
||||||
|
- fevent.focus_change.in = 0;
|
||||||
|
- fevent.focus_change.window = get_window();
|
||||||
|
- m_entry.send_focus_change(fevent);
|
||||||
|
- fevent.focus_change.window = null;
|
||||||
|
-
|
||||||
|
hide();
|
||||||
|
// Make sure the switcher is hidden before returning from this function.
|
||||||
|
while (Gtk.events_pending())
|
||||||
|
@@ -2357,36 +2281,9 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
- case Gdk.Key.BackSpace:
|
||||||
|
- if (m_entry.get_text().length > 0) {
|
||||||
|
- if ((modifiers & Gdk.ModifierType.CONTROL_MASK) != 0) {
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "delete-from-cursor",
|
||||||
|
- Gtk.DeleteType.WORD_ENDS, -1);
|
||||||
|
- } else {
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "backspace");
|
||||||
|
- }
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
- case Gdk.Key.Delete:
|
||||||
|
- case Gdk.Key.KP_Delete:
|
||||||
|
- if (m_entry.get_text().length > 0) {
|
||||||
|
- if ((modifiers & Gdk.ModifierType.CONTROL_MASK) != 0) {
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "delete-from-cursor",
|
||||||
|
- Gtk.DeleteType.WORD_ENDS, 1);
|
||||||
|
- } else {
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "delete-from-cursor",
|
||||||
|
- Gtk.DeleteType.CHARS, 1);
|
||||||
|
- }
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
case Gdk.Key.space:
|
||||||
|
case Gdk.Key.KP_Space:
|
||||||
|
- if ((modifiers & Gdk.ModifierType.SHIFT_MASK) != 0) {
|
||||||
|
- if (m_entry.get_text().length > 0)
|
||||||
|
- entry_enter_keyval(keyval);
|
||||||
|
- } else if (m_candidate_panel_is_visible) {
|
||||||
|
+ if (m_candidate_panel_is_visible) {
|
||||||
|
enter_notify_disable_with_timer();
|
||||||
|
m_lookup_table.cursor_down();
|
||||||
|
show_candidate_panel();
|
||||||
|
@@ -2436,10 +2333,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
key_press_cursor_home_end(Gdk.Key.End, modifiers);
|
||||||
|
show_all();
|
||||||
|
return true;
|
||||||
|
- case Gdk.Key.Insert:
|
||||||
|
- case Gdk.Key.KP_Insert:
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "toggle-overwrite");
|
||||||
|
- return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((modifiers & Gdk.ModifierType.CONTROL_MASK) != 0) {
|
||||||
|
@@ -2470,27 +2363,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
key_press_cursor_home_end(Gdk.Key.End, modifiers);
|
||||||
|
show_all();
|
||||||
|
return true;
|
||||||
|
- case Gdk.Key.u:
|
||||||
|
- if (m_entry.get_text().length > 0) {
|
||||||
|
- GLib.Signal.emit_by_name(m_entry,
|
||||||
|
- "delete-from-cursor",
|
||||||
|
- Gtk.DeleteType.PARAGRAPH_ENDS,
|
||||||
|
- -1);
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
- case Gdk.Key.a:
|
||||||
|
- if (m_entry.get_text().length > 0) {
|
||||||
|
- m_entry.select_region(0, -1);
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
- case Gdk.Key.x:
|
||||||
|
- if (m_entry.get_text().length > 0) {
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "cut-clipboard");
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
case Gdk.Key.C:
|
||||||
|
case Gdk.Key.c:
|
||||||
|
if ((modifiers & Gdk.ModifierType.SHIFT_MASK) != 0) {
|
||||||
|
@@ -2503,19 +2375,11 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
clipboard.store();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
- } else if (m_entry.get_text().length > 0) {
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "copy-clipboard");
|
||||||
|
- return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
- case Gdk.Key.v:
|
||||||
|
- GLib.Signal.emit_by_name(m_entry, "paste-clipboard");
|
||||||
|
- return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- entry_enter_keyval(keyval);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2595,7 +2459,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
|
||||||
|
uint32 timestamp = event.get_time();
|
||||||
|
present_with_time(timestamp);
|
||||||
|
- m_entry.set_activates_default(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
||||||
|
From e6badb494e0a31b7aca3a5078a5dc5b27b83390d Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Thu, 30 Aug 2018 12:57:46 +0900
|
||||||
|
Subject: [PATCH] ui/gtk3: Support Shift-Space to insert a Space on Emojier
|
||||||
|
preedit
|
||||||
|
|
||||||
|
Implemented Shift-Space on preedit since Shift-Space had worked on
|
||||||
|
Emojier's GtkEntry in the previous release.
|
||||||
|
---
|
||||||
|
ui/gtk3/panelbinding.vala | 27 ++++++++++++++++++++-------
|
||||||
|
1 file changed, 20 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
|
||||||
|
index 981b5509..4ebff8da 100644
|
||||||
|
--- a/ui/gtk3/panelbinding.vala
|
||||||
|
+++ b/ui/gtk3/panelbinding.vala
|
||||||
|
@@ -548,6 +548,19 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
+ private bool key_press_keyval(uint keyval) {
|
||||||
|
+ unichar ch = IBus.keyval_to_unicode(keyval);
|
||||||
|
+ if (ch.iscntrl())
|
||||||
|
+ return false;
|
||||||
|
+ string str = ch.to_string();
|
||||||
|
+ m_preedit.append_text(str);
|
||||||
|
+ string annotation = m_preedit.get_text();
|
||||||
|
+ m_emojier.set_annotation(annotation);
|
||||||
|
+ m_preedit.set_emoji("");
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
private bool key_press_enter() {
|
||||||
|
if (m_extension_name != "unicode" && is_emoji_lookup_table()) {
|
||||||
|
// Check if variats exist
|
||||||
|
@@ -899,6 +912,12 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
break;
|
||||||
|
case Gdk.Key.space:
|
||||||
|
case Gdk.Key.KP_Space:
|
||||||
|
+ if ((modifiers & Gdk.ModifierType.SHIFT_MASK) != 0) {
|
||||||
|
+ if (!key_press_keyval(keyval))
|
||||||
|
+ return true;
|
||||||
|
+ show_candidate = is_emoji_lookup_table();
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
show_candidate = key_press_space();
|
||||||
|
if (m_extension_name == "unicode") {
|
||||||
|
key_press_enter();
|
||||||
|
@@ -979,14 +998,8 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
show_candidate = key_press_control_keyval(keyval, modifiers);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
- unichar ch = IBus.keyval_to_unicode(keyval);
|
||||||
|
- if (ch.iscntrl())
|
||||||
|
+ if (!key_press_keyval(keyval))
|
||||||
|
return true;
|
||||||
|
- string str = ch.to_string();
|
||||||
|
- m_preedit.append_text(str);
|
||||||
|
- string annotation = m_preedit.get_text();
|
||||||
|
- m_emojier.set_annotation(annotation);
|
||||||
|
- m_preedit.set_emoji("");
|
||||||
|
show_candidate = is_emoji_lookup_table();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
||||||
|
From 809d880337e75b7cee429292a238bf53899bef6a Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Thu, 30 Aug 2018 12:58:57 +0900
|
||||||
|
Subject: [PATCH] ui/gtk3: Do not move Emojier popup with the active
|
||||||
|
candidate in Xorg
|
||||||
|
|
||||||
|
Probably I think it's not useful to change the popup position frequently.
|
||||||
|
The popup size is always slightly changed with the emoji annotation length.
|
||||||
|
---
|
||||||
|
ui/gtk3/emojier.vala | 10 +++++++++-
|
||||||
|
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
|
||||||
|
index 0f455800..9811fde5 100644
|
||||||
|
--- a/ui/gtk3/emojier.vala
|
||||||
|
+++ b/ui/gtk3/emojier.vala
|
||||||
|
@@ -1944,7 +1944,15 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
x = 0;
|
||||||
|
|
||||||
|
bool changed = false;
|
||||||
|
- if (window_right_bottom.y > monitor_bottom) {
|
||||||
|
+ // Do not up side down frequently.
|
||||||
|
+ // The first pos does not show the lookup table yet but the
|
||||||
|
+ // preedit only and the second pos shows the lookup table.
|
||||||
|
+ if (m_lookup_table.get_cursor_pos() != 1) {
|
||||||
|
+ if (m_is_up_side_down)
|
||||||
|
+ y = m_cursor_location.y - allocation.height;
|
||||||
|
+ else
|
||||||
|
+ y = cursor_right_bottom.y;
|
||||||
|
+ } else if (window_right_bottom.y > monitor_bottom) {
|
||||||
|
y = m_cursor_location.y - allocation.height;
|
||||||
|
// Do not up side down in Wayland
|
||||||
|
if (m_input_context_path == "") {
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
||||||
|
From 1c6565e205528a45e88a84ba2a328f9035875c8d Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Fri, 14 Sep 2018 16:15:41 +0900
|
||||||
|
Subject: [PATCH] ui/gtk3: Fix SEGV when commit an emoji on Emojier in Wayland
|
||||||
|
|
||||||
|
Just pressing Space key without emoji annotations can launch Emojier
|
||||||
|
popup and the popup takes a focus in Wayland and the chosen emoji is
|
||||||
|
output when the original text application gets the focus after Emojier
|
||||||
|
popup release the focus. Emojier disabled Ctrl-Shift-e after got the focus.
|
||||||
|
But currently GNOME Wayland has a bug not to send focus-in until a
|
||||||
|
key press or mouse click happens [1] and Emojier causes a SEGV.
|
||||||
|
Now Emojier disables Ctrl-Shift-e immediately when an emoji is chosen
|
||||||
|
whether focus-in comes or not and fixes the SEGV.
|
||||||
|
|
||||||
|
[1] https://gitlab.gnome.org/GNOME/gnome-shell/issues/573
|
||||||
|
|
||||||
|
BUG=rhbz#1625187
|
||||||
|
---
|
||||||
|
ui/gtk3/emojier.vala | 63 +++++++-------------------------------
|
||||||
|
ui/gtk3/emojierapp.vala | 2 +-
|
||||||
|
ui/gtk3/panelbinding.vala | 64 ++++++++++++++++++++++++++-------------
|
||||||
|
3 files changed, 55 insertions(+), 74 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
|
||||||
|
index 9811fde5..e23ef889 100644
|
||||||
|
--- a/ui/gtk3/emojier.vala
|
||||||
|
+++ b/ui/gtk3/emojier.vala
|
||||||
|
@@ -21,17 +21,6 @@
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
- private class EEntry : Gtk.SearchEntry {
|
||||||
|
- public EEntry() {
|
||||||
|
- GLib.Object(
|
||||||
|
- name : "IBusEmojierEntry",
|
||||||
|
- margin_start : 6,
|
||||||
|
- margin_end : 6,
|
||||||
|
- margin_top : 6,
|
||||||
|
- margin_bottom : 6
|
||||||
|
- );
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
private class EListBox : Gtk.ListBox {
|
||||||
|
public EListBox() {
|
||||||
|
GLib.Object(
|
||||||
|
@@ -330,6 +319,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
private uint m_redraw_window_id;
|
||||||
|
|
||||||
|
public signal void candidate_clicked(uint index, uint button, uint state);
|
||||||
|
+ public signal void commit_text(string text);
|
||||||
|
|
||||||
|
public IBusEmojier() {
|
||||||
|
GLib.Object(
|
||||||
|
@@ -380,12 +370,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
adjust_window_position();
|
||||||
|
});
|
||||||
|
|
||||||
|
- candidate_clicked.connect((i, b, s) => {
|
||||||
|
- if (m_input_context_path != "")
|
||||||
|
- candidate_panel_select_index(i, b);
|
||||||
|
- });
|
||||||
|
-
|
||||||
|
-
|
||||||
|
if (m_annotation_to_emojis_dict == null) {
|
||||||
|
reload_emoji_dict();
|
||||||
|
}
|
||||||
|
@@ -1641,34 +1625,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- private void candidate_panel_select_index(uint index,
|
||||||
|
- uint button) {
|
||||||
|
- if (button == BUTTON_CLOSE_BUTTON) {
|
||||||
|
- hide();
|
||||||
|
- if (m_candidate_panel_mode &&
|
||||||
|
- m_lookup_table.get_number_of_candidates() > 0) {
|
||||||
|
- // Call remove_all_children() instead of show_category_list()
|
||||||
|
- // so that show_category_list do not remove children with
|
||||||
|
- // PageUp/PageDown.
|
||||||
|
- remove_all_children();
|
||||||
|
- }
|
||||||
|
- m_result = "";
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- string text = m_lookup_table.get_candidate(index).text;
|
||||||
|
- unowned GLib.SList<string>? emojis =
|
||||||
|
- m_emoji_to_emoji_variants_dict.lookup(text);
|
||||||
|
- if (m_show_emoji_variant && emojis != null &&
|
||||||
|
- m_backward_index < 0) {
|
||||||
|
- show_emoji_variants(emojis);
|
||||||
|
- show_all();
|
||||||
|
- } else {
|
||||||
|
- m_result = text;
|
||||||
|
- hide();
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-
|
||||||
|
private void candidate_panel_cursor_down() {
|
||||||
|
enter_notify_disable_with_timer();
|
||||||
|
uint ncandidates = m_lookup_table.get_number_of_candidates();
|
||||||
|
@@ -1762,7 +1718,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- public bool has_variants(uint index) {
|
||||||
|
+ public bool has_variants(uint index,
|
||||||
|
+ bool need_commit_signal) {
|
||||||
|
if (index >= m_lookup_table.get_number_of_candidates())
|
||||||
|
return false;
|
||||||
|
string text = m_lookup_table.get_candidate(index).text;
|
||||||
|
@@ -1773,6 +1730,10 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
show_emoji_variants(emojis);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
+ if (m_input_context_path != "")
|
||||||
|
+ m_result = text;
|
||||||
|
+ if (need_commit_signal)
|
||||||
|
+ commit_text(text);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -1881,10 +1842,10 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- public bool key_press_enter() {
|
||||||
|
+ public bool key_press_enter(bool need_commit_signal) {
|
||||||
|
if (m_candidate_panel_is_visible) {
|
||||||
|
uint index = m_lookup_table.get_cursor_pos();
|
||||||
|
- return has_variants(index);
|
||||||
|
+ return has_variants(index, need_commit_signal);
|
||||||
|
} else if (m_category_active_index >= 0) {
|
||||||
|
Gtk.ListBoxRow gtkrow = m_list_box.get_selected_row();
|
||||||
|
EBoxRow row = gtkrow as EBoxRow;
|
||||||
|
@@ -2282,12 +2243,10 @@ public class IBusEmojier : Gtk.ApplicationWindow {
|
||||||
|
return true;
|
||||||
|
case Gdk.Key.Return:
|
||||||
|
case Gdk.Key.KP_Enter:
|
||||||
|
- if (key_press_enter()) {
|
||||||
|
+ if (key_press_enter(true))
|
||||||
|
show_all();
|
||||||
|
- } else {
|
||||||
|
- m_result = get_current_candidate();
|
||||||
|
+ else
|
||||||
|
hide();
|
||||||
|
- }
|
||||||
|
return true;
|
||||||
|
case Gdk.Key.space:
|
||||||
|
case Gdk.Key.KP_Space:
|
||||||
|
diff --git a/ui/gtk3/emojierapp.vala b/ui/gtk3/emojierapp.vala
|
||||||
|
index 787d448f..fab99d9e 100644
|
||||||
|
--- a/ui/gtk3/emojierapp.vala
|
||||||
|
+++ b/ui/gtk3/emojierapp.vala
|
||||||
|
@@ -65,7 +65,7 @@ public class EmojiApplication : Gtk.Application {
|
||||||
|
uint ncandidates = m_emojier.get_number_of_candidates();
|
||||||
|
if (ncandidates > 0 && ncandidates >= index) {
|
||||||
|
m_emojier.set_cursor_pos(index);
|
||||||
|
- show_candidate = m_emojier.has_variants(index);
|
||||||
|
+ show_candidate = m_emojier.has_variants(index, false);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
|
||||||
|
index 4ebff8da..01c43b0d 100644
|
||||||
|
--- a/ui/gtk3/panelbinding.vala
|
||||||
|
+++ b/ui/gtk3/panelbinding.vala
|
||||||
|
@@ -447,13 +447,19 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- private void commit_text_update_favorites(IBus.Text text) {
|
||||||
|
+ private void commit_text_update_favorites(IBus.Text text,
|
||||||
|
+ bool disable_extension) {
|
||||||
|
commit_text(text);
|
||||||
|
- IBus.ExtensionEvent event = new IBus.ExtensionEvent(
|
||||||
|
+
|
||||||
|
+ // If disable_extension is false, the extension event is already
|
||||||
|
+ // sent before the focus-in is received.
|
||||||
|
+ if (disable_extension) {
|
||||||
|
+ IBus.ExtensionEvent event = new IBus.ExtensionEvent(
|
||||||
|
"name", m_extension_name,
|
||||||
|
"is-enabled", false,
|
||||||
|
"is-extension", true);
|
||||||
|
- panel_extension(event);
|
||||||
|
+ panel_extension(event);
|
||||||
|
+ }
|
||||||
|
string committed_string = text.text;
|
||||||
|
string preedit_string = m_preedit.get_text();
|
||||||
|
m_preedit.hide();
|
||||||
|
@@ -482,7 +488,7 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
prev_context_path != "" &&
|
||||||
|
prev_context_path == m_current_context_path) {
|
||||||
|
IBus.Text text = new IBus.Text.from_string(selected_string);
|
||||||
|
- commit_text_update_favorites(text);
|
||||||
|
+ commit_text_update_favorites(text, false);
|
||||||
|
m_emojier.reset();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@@ -564,13 +570,13 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
private bool key_press_enter() {
|
||||||
|
if (m_extension_name != "unicode" && is_emoji_lookup_table()) {
|
||||||
|
// Check if variats exist
|
||||||
|
- if (m_emojier.key_press_enter()) {
|
||||||
|
+ if (m_emojier.key_press_enter(false)) {
|
||||||
|
convert_preedit_text();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IBus.Text text = m_preedit.get_commit_text();
|
||||||
|
- commit_text_update_favorites(text);
|
||||||
|
+ commit_text_update_favorites(text, true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -712,15 +718,10 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- private bool is_visible_wayland_lookup_table() {
|
||||||
|
- return m_wayland_lookup_table_is_visible;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-
|
||||||
|
private void hide_emoji_lookup_table() {
|
||||||
|
if (m_emojier == null)
|
||||||
|
return;
|
||||||
|
- if (m_is_wayland)
|
||||||
|
+ if (m_wayland_lookup_table_is_visible)
|
||||||
|
hide_wayland_lookup_table();
|
||||||
|
else
|
||||||
|
m_emojier.hide();
|
||||||
|
@@ -747,7 +748,7 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
|
||||||
|
private bool is_emoji_lookup_table() {
|
||||||
|
if (m_is_wayland)
|
||||||
|
- return is_visible_wayland_lookup_table();
|
||||||
|
+ return m_wayland_lookup_table_is_visible;
|
||||||
|
else
|
||||||
|
return m_emojier.get_visible();
|
||||||
|
}
|
||||||
|
@@ -788,7 +789,8 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
*/
|
||||||
|
if (!input_context_path.has_suffix("InputContext_1")) {
|
||||||
|
m_real_current_context_path = m_current_context_path;
|
||||||
|
- this.emojier_focus_commit();
|
||||||
|
+ if (m_is_wayland)
|
||||||
|
+ this.emojier_focus_commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -822,8 +824,18 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
// For title handling in gnome-shell
|
||||||
|
m_application.add_window(m_emojier);
|
||||||
|
m_emojier.candidate_clicked.connect((i, b, s) => {
|
||||||
|
+ candidate_clicked_lookup_table_real(i, b, s, true);
|
||||||
|
+ });
|
||||||
|
+ m_emojier.commit_text.connect((s) => {
|
||||||
|
if (!m_is_wayland)
|
||||||
|
- candidate_clicked_lookup_table(i, b, s);
|
||||||
|
+ return;
|
||||||
|
+ // Currently emojier has a focus but the text input focus
|
||||||
|
+ // does not and commit the text later.
|
||||||
|
+ IBus.ExtensionEvent close_event = new IBus.ExtensionEvent(
|
||||||
|
+ "name", m_extension_name,
|
||||||
|
+ "is-enabled", false,
|
||||||
|
+ "is-extension", true);
|
||||||
|
+ panel_extension(close_event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
m_emojier.reset();
|
||||||
|
@@ -1041,9 +1053,10 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
show_preedit_and_candidate(show_candidate);
|
||||||
|
}
|
||||||
|
|
||||||
|
- public override void candidate_clicked_lookup_table(uint index,
|
||||||
|
- uint button,
|
||||||
|
- uint state) {
|
||||||
|
+ private void candidate_clicked_lookup_table_real(uint index,
|
||||||
|
+ uint button,
|
||||||
|
+ uint state,
|
||||||
|
+ bool is_emojier) {
|
||||||
|
if (button == IBusEmojier.BUTTON_CLOSE_BUTTON) {
|
||||||
|
m_enable_extension = false;
|
||||||
|
hide_emoji_lookup_table();
|
||||||
|
@@ -1061,17 +1074,26 @@ class PanelBinding : IBus.PanelService {
|
||||||
|
uint ncandidates = m_emojier.get_number_of_candidates();
|
||||||
|
if (ncandidates > 0 && ncandidates >= index) {
|
||||||
|
m_emojier.set_cursor_pos(index);
|
||||||
|
- show_candidate = m_emojier.has_variants(index);
|
||||||
|
- m_preedit.set_emoji(m_emojier.get_current_candidate());
|
||||||
|
+ bool need_commit_signal = m_is_wayland && is_emojier;
|
||||||
|
+ show_candidate = m_emojier.has_variants(index, need_commit_signal);
|
||||||
|
+ if (!m_is_wayland)
|
||||||
|
+ m_preedit.set_emoji(m_emojier.get_current_candidate());
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!show_candidate) {
|
||||||
|
IBus.Text text = m_preedit.get_commit_text();
|
||||||
|
- commit_text_update_favorites(text);
|
||||||
|
hide_emoji_lookup_table();
|
||||||
|
+ if (!is_emojier || !m_is_wayland)
|
||||||
|
+ commit_text_update_favorites(text, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
show_preedit_and_candidate(show_candidate);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ public override void candidate_clicked_lookup_table(uint index,
|
||||||
|
+ uint button,
|
||||||
|
+ uint state) {
|
||||||
|
+ candidate_clicked_lookup_table_real(index, button, state, false);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
||||||
|
From c1b55431c076dfa3fc26a3a998bfcf729e9ba602 Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Fri, 26 Oct 2018 18:44:35 +0900
|
||||||
|
Subject: [PATCH] src/tests: Fix make check in Fedora 29
|
||||||
|
|
||||||
|
ibus-bus and ibus-compose failed in Fedora 29.
|
||||||
|
|
||||||
|
1. In ibus-bus with runtest, ibus-daemon failed to restart in
|
||||||
|
start_exit_async() because it seems to have conflicting IO with runtest
|
||||||
|
and ibus-daemon failed to close a file descriptor in _restart_server().
|
||||||
|
The solution is to add a sleep in start_exit_async().
|
||||||
|
Also added ibus_get_address() in test_async_apis_finish() to check
|
||||||
|
if ibus-daemon finished to restart.
|
||||||
|
|
||||||
|
2. In ibus-compose, the GTK application could not get the ibus module.
|
||||||
|
The solution is to export GTK_IM_MODULE=ibus.
|
||||||
|
|
||||||
|
3. Added DISABLE_DAEMONIZE_IN_TESTS to get error messages in ibus-daemon.
|
||||||
|
% make DISABLE_DAEMONIZE_IN_TESTS=1 check
|
||||||
|
---
|
||||||
|
bus/Makefile.am | 1 +
|
||||||
|
src/tests/Makefile.am | 1 +
|
||||||
|
src/tests/ibus-bus.c | 15 ++++++++++++++-
|
||||||
|
src/tests/runtest | 24 +++++++++++++++++-------
|
||||||
|
4 files changed, 33 insertions(+), 8 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/bus/Makefile.am b/bus/Makefile.am
|
||||||
|
index bdae5c92..4383a874 100644
|
||||||
|
--- a/bus/Makefile.am
|
||||||
|
+++ b/bus/Makefile.am
|
||||||
|
@@ -124,6 +124,7 @@ TESTS_ENVIRONMENT = \
|
||||||
|
srcdir=$(srcdir) \
|
||||||
|
LD_LIBRARY_PATH="$(top_builddir)/src/.libs:$(top_builddir)/src" \
|
||||||
|
DISABLE_GUI_TESTS="$(DISABLE_GUI_TESTS)" \
|
||||||
|
+ DISABLE_DAEMONIZE_IN_TESTS="$(DISABLE_DAEMONIZE_IN_TESTS)" \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOG_COMPILER = $(top_srcdir)/src/tests/runtest
|
||||||
|
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
|
||||||
|
index c5fef3c8..e337a59b 100644
|
||||||
|
--- a/src/tests/Makefile.am
|
||||||
|
+++ b/src/tests/Makefile.am
|
||||||
|
@@ -73,6 +73,7 @@ TESTS_ENVIRONMENT = \
|
||||||
|
srcdir=$(srcdir) \
|
||||||
|
LD_LIBRARY_PATH="$(top_builddir)/src/.libs:$(top_builddir)/src" \
|
||||||
|
DISABLE_GUI_TESTS="$(DISABLE_GUI_TESTS)" \
|
||||||
|
+ DISABLE_DAEMONIZE_IN_TESTS="$(DISABLE_DAEMONIZE_IN_TESTS)" \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
LOG_COMPILER = $(srcdir)/runtest
|
||||||
|
diff --git a/src/tests/ibus-bus.c b/src/tests/ibus-bus.c
|
||||||
|
index 7fa1bc4a..0bf9e612 100644
|
||||||
|
--- a/src/tests/ibus-bus.c
|
||||||
|
+++ b/src/tests/ibus-bus.c
|
||||||
|
@@ -820,6 +820,14 @@ finish_exit_async (GObject *source_object,
|
||||||
|
static void
|
||||||
|
start_exit_async (void)
|
||||||
|
{
|
||||||
|
+ /* When `./runtest ibus-bus` runs, ibus-daemon sometimes failed to
|
||||||
|
+ * restart because closing a file descriptor was failed in
|
||||||
|
+ * bus/server.c:_restart_server() with a following error:
|
||||||
|
+ * "inotify read(): Bad file descriptor"
|
||||||
|
+ * Now g_usleep() is added here to write down the buffer and not to
|
||||||
|
+ * fail to restart ibus-daemon.
|
||||||
|
+ */
|
||||||
|
+ g_usleep (G_USEC_PER_SEC);
|
||||||
|
ibus_bus_exit_async (bus,
|
||||||
|
TRUE, /* restart */
|
||||||
|
-1, /* timeout */
|
||||||
|
@@ -831,6 +839,9 @@ start_exit_async (void)
|
||||||
|
static gboolean
|
||||||
|
test_async_apis_finish (gpointer user_data)
|
||||||
|
{
|
||||||
|
+ /* INFO: g_warning() causes SEGV with runtest script */
|
||||||
|
+ if (ibus_get_address () == NULL)
|
||||||
|
+ g_warning ("ibus-daemon does not restart yet from start_exit_async().");
|
||||||
|
ibus_quit ();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
@@ -906,7 +917,9 @@ call_next_async_function (void)
|
||||||
|
};
|
||||||
|
static guint index = 0;
|
||||||
|
|
||||||
|
- // Use g_timeout_add to make sure test_async_apis finishes even if async_functions is empty.
|
||||||
|
+ /* Use g_timeout_add to make sure test_async_apis finishes even if
|
||||||
|
+ * async_functions is empty.
|
||||||
|
+ */
|
||||||
|
if (index >= G_N_ELEMENTS (async_functions))
|
||||||
|
g_timeout_add (1, test_async_apis_finish, NULL);
|
||||||
|
else
|
||||||
|
diff --git a/src/tests/runtest b/src/tests/runtest
|
||||||
|
index d7f96ea3..ab39e9f2 100755
|
||||||
|
--- a/src/tests/runtest
|
||||||
|
+++ b/src/tests/runtest
|
||||||
|
@@ -22,6 +22,7 @@
|
||||||
|
: ${builddir:=.}
|
||||||
|
: ${srcdir:=.}
|
||||||
|
: ${DISABLE_GUI_TESTS:=''}
|
||||||
|
+: ${DISABLE_DAEMONIZE_IN_TESTS:=''}
|
||||||
|
|
||||||
|
BUS_REQUIRED_TESTS="
|
||||||
|
ibus-bus
|
||||||
|
@@ -162,16 +163,25 @@ run_test_case()
|
||||||
|
export GSETTINGS_SCHEMA_DIR=$PWD
|
||||||
|
|
||||||
|
# Start ibus-daemon.
|
||||||
|
- ../$top_builddir/bus/ibus-daemon \
|
||||||
|
- --daemonize \
|
||||||
|
- --cache=none \
|
||||||
|
- --panel=disable \
|
||||||
|
- --emoji-extension=disable \
|
||||||
|
- --config=default \
|
||||||
|
- --verbose;
|
||||||
|
+ DAEMON_ARGS='
|
||||||
|
+ --cache=none
|
||||||
|
+ --panel=disable
|
||||||
|
+ --emoji-extension=disable
|
||||||
|
+ --config=default
|
||||||
|
+ --verbose
|
||||||
|
+ '
|
||||||
|
+ if test x"$DISABLE_DAEMONIZE_IN_TESTS" = x ; then
|
||||||
|
+ ../$top_builddir/bus/ibus-daemon \
|
||||||
|
+ $DAEMON_ARGS --daemonize;
|
||||||
|
+ else
|
||||||
|
+ ../$top_builddir/bus/ibus-daemon \
|
||||||
|
+ $DAEMON_ARGS &
|
||||||
|
+ fi
|
||||||
|
|
||||||
|
# Wait until all necessary components are up.
|
||||||
|
sleep 1
|
||||||
|
+
|
||||||
|
+ export GTK_IM_MODULE=ibus
|
||||||
|
fi
|
||||||
|
|
||||||
|
"../$tst" ${1+"$@"}
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
||||||
|
From 3172c3b23faefe76b3b7adfc75f9be34a0fb2e02 Mon Sep 17 00:00:00 2001
|
||||||
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
|
Date: Wed, 31 Oct 2018 17:42:38 +0900
|
||||||
|
Subject: [PATCH] RHEL code reviews
|
||||||
|
|
||||||
|
---
|
||||||
|
src/ibuskeymap.c | 2 +-
|
||||||
|
src/ibuspanelservice.c | 6 +++++-
|
||||||
|
src/tests/ibus-keypress.c | 2 +-
|
||||||
|
util/IMdkit/FrameMgr.c | 1 +
|
||||||
|
4 files changed, 8 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/ibuskeymap.c b/src/ibuskeymap.c
|
||||||
|
index 27a56754..5abfb99a 100644
|
||||||
|
--- a/src/ibuskeymap.c
|
||||||
|
+++ b/src/ibuskeymap.c
|
||||||
|
@@ -143,7 +143,7 @@ ibus_keymap_parse_line (gchar *str,
|
||||||
|
/* Do not assign *p1 to g_ascii_isalpha() directly for the syntax check */
|
||||||
|
if (i == 0 &&
|
||||||
|
strncmp (p2, "addupper", sizeof ("addupper") - 1) == 0 &&
|
||||||
|
- (ch = *p1) && g_ascii_isalpha (ch)) {
|
||||||
|
+ (ch = *p1) && (ch >= 0) && g_ascii_isalpha (ch)) {
|
||||||
|
gchar buf[] = "a";
|
||||||
|
buf[0] = g_ascii_toupper(ch);
|
||||||
|
keymap[keycode][0] = keymap[keycode][3] = keysym;
|
||||||
|
diff --git a/src/ibuspanelservice.c b/src/ibuspanelservice.c
|
||||||
|
index 9d87e19b..984cc890 100644
|
||||||
|
--- a/src/ibuspanelservice.c
|
||||||
|
+++ b/src/ibuspanelservice.c
|
||||||
|
@@ -1615,7 +1615,11 @@ ibus_panel_service_panel_extension_register_keys (IBusPanelService *panel,
|
||||||
|
va_start (var_args, first_property_name);
|
||||||
|
do {
|
||||||
|
keys = va_arg (var_args, IBusProcessKeyEventData *);
|
||||||
|
- g_return_if_fail (keys != NULL);
|
||||||
|
+ if (keys == NULL) {
|
||||||
|
+ va_end (var_args);
|
||||||
|
+ g_warning ("Failed to va_arg for IBusProcessKeyEventData");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
g_variant_builder_init (&child, G_VARIANT_TYPE ("av"));
|
||||||
|
for (; keys; keys++) {
|
||||||
|
if (keys->keyval == 0 && keys->keycode == 0 && keys->state == 0)
|
||||||
|
diff --git a/src/tests/ibus-keypress.c b/src/tests/ibus-keypress.c
|
||||||
|
index 3486523b..17920226 100644
|
||||||
|
--- a/src/tests/ibus-keypress.c
|
||||||
|
+++ b/src/tests/ibus-keypress.c
|
||||||
|
@@ -173,7 +173,7 @@ set_engine_cb (GObject *object,
|
||||||
|
IBusBus *bus = IBUS_BUS (object);
|
||||||
|
GtkWidget *entry = GTK_WIDGET (data);
|
||||||
|
GdkDisplay *display;
|
||||||
|
- Display *xdisplay;
|
||||||
|
+ Display *xdisplay = NULL;
|
||||||
|
GError *error = NULL;
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
diff --git a/util/IMdkit/FrameMgr.c b/util/IMdkit/FrameMgr.c
|
||||||
|
index 084b8810..0e91b78e 100644
|
||||||
|
--- a/util/IMdkit/FrameMgr.c
|
||||||
|
+++ b/util/IMdkit/FrameMgr.c
|
||||||
|
@@ -1414,6 +1414,7 @@ static int FrameInstGetSize (FrameInst fi)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/*endswitch*/
|
||||||
|
+ assert (i >= 0);
|
||||||
|
i = _FrameInstIncrement (fi->template, i);
|
||||||
|
}
|
||||||
|
/*endwhile*/
|
||||||
|
--
|
||||||
|
2.17.1
|
||||||
|
|
18
SOURCES/ibus-xinput
Normal file
18
SOURCES/ibus-xinput
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
XIM=ibus
|
||||||
|
XIM_PROGRAM="/usr/bin/ibus-daemon"
|
||||||
|
ICON="ibus"
|
||||||
|
XIM_ARGS="-r --xim"
|
||||||
|
PREFERENCE_PROGRAM=/usr/bin/ibus-setup
|
||||||
|
SHORT_DESC="IBus"
|
||||||
|
GTK_IM_MODULE=ibus
|
||||||
|
NOT_RUN=gnome3
|
||||||
|
|
||||||
|
if test -f /usr/lib64/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so || \
|
||||||
|
test -f /usr/lib/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so || \
|
||||||
|
test -f /usr/lib64/qt4/plugins/inputmethods/libqtim-ibus.so || \
|
||||||
|
test -f /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so;
|
||||||
|
then
|
||||||
|
QT_IM_MODULE=ibus
|
||||||
|
else
|
||||||
|
QT_IM_MODULE=xim
|
||||||
|
fi
|
73
SOURCES/ibus.conf.5
Normal file
73
SOURCES/ibus.conf.5
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
.\" This file is distributed under the same license as the ibus
|
||||||
|
.\" package.
|
||||||
|
.\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2013.
|
||||||
|
.\"
|
||||||
|
.TH IBUS.CONF "5" "August 2013" "1.5.3" "User Commands"
|
||||||
|
.SH NAME
|
||||||
|
.B ibus.conf
|
||||||
|
\- X input preload/configuration file for ibus
|
||||||
|
|
||||||
|
.SH SYNOPSIS
|
||||||
|
.B /etc/X11/xinit/xinput.d/ibus.conf
|
||||||
|
|
||||||
|
.SH DESCRIPTION
|
||||||
|
|
||||||
|
.PP
|
||||||
|
IBus is an Intelligent Input Bus. It is a new input framework for Linux
|
||||||
|
OS. It provides full featured and user friendly input method user
|
||||||
|
interface. It also may help developers to develop input method easily.
|
||||||
|
|
||||||
|
.PP
|
||||||
|
.B ibus.conf
|
||||||
|
is a configuration file containing X input setting values to be read in
|
||||||
|
and set by /etc/X11/xinit/xinitrc\-common.
|
||||||
|
.I imsettings-switch(1)
|
||||||
|
is called from XDG auto\-start and invokes
|
||||||
|
xinitrc\-common.
|
||||||
|
.LP
|
||||||
|
If this file is the alias of
|
||||||
|
.I /etc/X11/xinit/xinputrc
|
||||||
|
for the system setting
|
||||||
|
or
|
||||||
|
.I [$XDG_CONFIG_HOME|$HOME/.config]/imsettings/xinputrc
|
||||||
|
for the user setting, the setting can be default.
|
||||||
|
.I im\-chooser(1)
|
||||||
|
can choose the user setting.
|
||||||
|
.LP
|
||||||
|
The configuration options are:
|
||||||
|
.TP
|
||||||
|
\fBXIM\fP
|
||||||
|
XIM name for XMODIFIERS
|
||||||
|
.TP
|
||||||
|
\fBXIM_PROGRAM\fP
|
||||||
|
XIM executable program name
|
||||||
|
.TP
|
||||||
|
\fBXIM_ARGS\fP
|
||||||
|
XIM arguments for XIM_PROGRAM
|
||||||
|
.TP
|
||||||
|
\fBSHORT_DESC\fP
|
||||||
|
XIM human readable name for
|
||||||
|
.I im\-chooser(1)
|
||||||
|
.TP
|
||||||
|
\fBICON\fP
|
||||||
|
icon file for
|
||||||
|
.I im\-chooser(1)
|
||||||
|
.TP
|
||||||
|
\fBPREFERENCE_PROGRAM\fP
|
||||||
|
XIM setup program for
|
||||||
|
.I im\-chooser(1)
|
||||||
|
.TP
|
||||||
|
\fBGTK_IM_MODULE\fP
|
||||||
|
IM environment valuable for GTK+ applications.
|
||||||
|
.TP
|
||||||
|
\fBQT_IM_MODULE\fP
|
||||||
|
IM environment valuable for QT applications.
|
||||||
|
|
||||||
|
.SH BUGS
|
||||||
|
If you find a bug, please report it at http://code.google.com/p/ibus/issues/list
|
||||||
|
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
.BR ibus\-daemon (1)
|
||||||
|
.BR imsettings\-switch (1)
|
||||||
|
.BR im\-chooser (1)
|
||||||
|
.BR X (7)
|
1543
SPECS/ibus.spec
Normal file
1543
SPECS/ibus.spec
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user