Fix several bugs

- Change XKB layout string color in panel
- Add Ctrl-semicolon to Emoji shortcut key
- Fix unref problems with floating references
- Update man page for Emoji shortcut key
- Add IBUS_INPUT_HINT_PRIVATE for browser private mode
- mkdir socket dirs instead of socket paths
This commit is contained in:
Takao Fujiwara 2022-02-03 14:48:02 +09:00
parent 81c4eabdbf
commit 7fd881404a
2 changed files with 475 additions and 1 deletions

View File

@ -1178,6 +1178,472 @@ index 83b04ebc..a80e41a5 100644
--
2.33.1
From 0e118e7e57caaa298e367ed99f2051ba47a35f81 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 20 Jan 2022 16:33:11 +0900
Subject: [PATCH] data/dconf: Change XKB layout string color in panel
Replace '#415099' with '#51a2da' in XKB layout string color
BUG=https://github.com/ibus/ibus/issues/2364
---
data/dconf/org.freedesktop.ibus.gschema.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml
index 099b9c60..e90ee5ab 100644
--- a/data/dconf/org.freedesktop.ibus.gschema.xml
+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
@@ -146,7 +146,7 @@
<description>Show input method name on language bar</description>
</key>
<key name="xkb-icon-rgba" type="s">
- <default>'#415099'</default>
+ <default>'#51a2da'</default>
<summary>RGBA value of XKB icon</summary>
<description>XKB icon shows the layout string and the string is rendered with the RGBA value. The RGBA value can be 1. a color name from X11, 2. a hex value in form '#rrggbb' where 'r', 'g' and 'b' are hex digits of the red, green, and blue, 3. a RGB color in form 'rgb(r,g,b)' or 4. a RGBA color in form 'rgba(r,g,b,a)' where 'r', 'g', and 'b' are either integers in the range 0 to 255 or percentage values in the range 0% to 100%, and 'a' is a floating point value in the range 0 to 1 of the alpha.</description>
</key>
--
2.33.1
From d9ff2bb6b04a7cf7d99f4e9832b4b8905858178c Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 20 Jan 2022 16:41:37 +0900
Subject: [PATCH] data/dconf: Add Ctrl-semicolon to Emoji shortcut key
period key is needed Shift key in French keyboard and Ctrl-period does
not work.
Add Ctrl-semicolon in org.freedesktop.ibus.panel.emoji.hotkey to fix
the problem.
BUG=https://github.com/ibus/ibus/issues/2360
---
data/dconf/org.freedesktop.ibus.gschema.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml
index e90ee5ab..516f7520 100644
--- a/data/dconf/org.freedesktop.ibus.gschema.xml
+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
@@ -183,7 +183,7 @@
<description>The shortcut keys for turning Unicode typing on or off</description>
</key>
<key name="hotkey" type="as">
- <default>[ '&lt;Control&gt;period' ]</default>
+ <default>[ '&lt;Control&gt;period', '&lt;Control&gt;semicolon' ]</default>
<summary>Emoji shortcut keys for gtk_accelerator_parse</summary>
<description>The shortcut keys for turning emoji typing on or off</description>
</key>
--
2.33.1
From 5a455b1ead5d72483952356ddfe25b9e3b637e6f Mon Sep 17 00:00:00 2001
From: Eberhard Beilharz <eb1@sil.org>
Date: Wed, 13 Oct 2021 19:00:47 +0200
Subject: [PATCH] Fix unref problems with floating references
When running with debug-enabled GLIB there are several critical
errors output: "A floating object ... was finalized. This means
that someone called g_object_unref() on an object that had only
a floating reference; the initial floating reference is not
owned by anyone and must be removed with g_object_ref_sink()."
This change fixes this by calling `g_object_ref_sink()` before
`g_object_unref()` if we have a floating reference.
It also fixes another related problem where we called
`g_object_unref()` on a static IBusText string (created with
`ibus_text_new_from_static_string()`) for which the API documentation
says not to free.
BUG=https://github.com/ibus/ibus/pull/2359
---
src/ibusinputcontext.c | 21 ++++++++++++++-------
src/ibusproperty.c | 32 ++++++++++++++++----------------
2 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
index 2b1438fc..4b27551b 100644
--- a/src/ibusinputcontext.c
+++ b/src/ibusinputcontext.c
@@ -550,7 +550,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
g_signal_emit (context, context_signals[COMMIT_TEXT], 0, text);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
if (g_strcmp0 (signal_name, "UpdatePreeditText") == 0) {
@@ -569,7 +570,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
visible);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
if (g_strcmp0 (signal_name, "UpdatePreeditTextWithMode") == 0) {
@@ -591,7 +593,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
mode);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
@@ -619,7 +622,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
text,
visible);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
@@ -637,7 +641,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
table,
visible);
if (g_object_is_floating (table))
- g_object_unref (table);
+ g_object_ref_sink (table);
+ g_object_unref (table);
return;
}
@@ -655,7 +660,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
prop_list);
if (g_object_is_floating (prop_list))
- g_object_unref (prop_list);
+ g_object_ref_sink (prop_list);
+ g_object_unref (prop_list);
return;
}
@@ -668,7 +674,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
g_signal_emit (context, context_signals[UPDATE_PROPERTY], 0, prop);
if (g_object_is_floating (prop))
- g_object_unref (prop);
+ g_object_ref_sink (prop);
+ g_object_unref (prop);
return;
}
diff --git a/src/ibusproperty.c b/src/ibusproperty.c
index e87d26b6..6d4ed088 100644
--- a/src/ibusproperty.c
+++ b/src/ibusproperty.c
@@ -336,17 +336,20 @@ ibus_property_destroy (IBusProperty *prop)
prop->priv->icon = NULL;
if (prop->priv->label) {
- g_object_unref (prop->priv->label);
+ if (!ibus_text_get_is_static (prop->priv->label))
+ g_object_unref (prop->priv->label);
prop->priv->label = NULL;
}
if (prop->priv->symbol) {
- g_object_unref (prop->priv->symbol);
+ if (!ibus_text_get_is_static (prop->priv->symbol))
+ g_object_unref (prop->priv->symbol);
prop->priv->symbol = NULL;
}
if (prop->priv->tooltip) {
- g_object_unref (prop->priv->tooltip);
+ if (!ibus_text_get_is_static (prop->priv->tooltip))
+ g_object_unref (prop->priv->tooltip);
prop->priv->tooltip = NULL;
}
@@ -401,7 +404,7 @@ ibus_property_deserialize (IBusProperty *prop,
g_variant_get_child (variant, retval++, "u", &prop->priv->type);
GVariant *subvar = g_variant_get_child_value (variant, retval++);
- if (prop->priv->label != NULL) {
+ if (prop->priv->label && !ibus_text_get_is_static (prop->priv->label)) {
g_object_unref (prop->priv->label);
}
prop->priv->label = IBUS_TEXT (ibus_serializable_deserialize (subvar));
@@ -411,7 +414,7 @@ ibus_property_deserialize (IBusProperty *prop,
ibus_g_variant_get_child_string (variant, retval++, &prop->priv->icon);
subvar = g_variant_get_child_value (variant, retval++);
- if (prop->priv->tooltip != NULL) {
+ if (prop->priv->tooltip && !ibus_text_get_is_static (prop->priv->tooltip)) {
g_object_unref (prop->priv->tooltip);
}
prop->priv->tooltip = IBUS_TEXT (ibus_serializable_deserialize (subvar));
@@ -432,7 +435,7 @@ ibus_property_deserialize (IBusProperty *prop,
/* Keep the serialized order for the compatibility when add new members. */
subvar = g_variant_get_child_value (variant, retval++);
- if (prop->priv->symbol != NULL) {
+ if (prop->priv->symbol && !ibus_text_get_is_static (prop->priv->symbol)) {
g_object_unref (prop->priv->symbol);
}
prop->priv->symbol = IBUS_TEXT (ibus_serializable_deserialize (subvar));
@@ -564,7 +567,7 @@ ibus_property_set_label (IBusProperty *prop,
g_assert (IBUS_IS_PROPERTY (prop));
g_return_if_fail (label == NULL || IBUS_IS_TEXT (label));
- if (prop->priv->label) {
+ if (prop->priv->label && !ibus_text_get_is_static (prop->priv->label)) {
g_object_unref (prop->priv->label);
}
@@ -583,7 +586,7 @@ ibus_property_set_symbol (IBusProperty *prop,
g_assert (IBUS_IS_PROPERTY (prop));
g_return_if_fail (symbol == NULL || IBUS_IS_TEXT (symbol));
- if (prop->priv->symbol) {
+ if (prop->priv->symbol && !ibus_text_get_is_static (prop->priv->symbol)) {
g_object_unref (prop->priv->symbol);
}
@@ -612,19 +615,16 @@ ibus_property_set_tooltip (IBusProperty *prop,
g_assert (IBUS_IS_PROPERTY (prop));
g_assert (tooltip == NULL || IBUS_IS_TEXT (tooltip));
- IBusPropertyPrivate *priv = prop->priv;
-
- if (priv->tooltip) {
- g_object_unref (priv->tooltip);
+ if (prop->priv->tooltip && !ibus_text_get_is_static (prop->priv->tooltip)) {
+ g_object_unref (prop->priv->tooltip);
}
if (tooltip == NULL) {
- priv->tooltip = ibus_text_new_from_static_string ("");
- g_object_ref_sink (priv->tooltip);
+ prop->priv->tooltip = ibus_text_new_from_static_string ("");
}
else {
- priv->tooltip = tooltip;
- g_object_ref_sink (priv->tooltip);
+ prop->priv->tooltip = tooltip;
+ g_object_ref_sink (prop->priv->tooltip);
}
}
--
2.33.1
From ad95015dc411f84dd9b8869e596e4707cd2ccd2b Mon Sep 17 00:00:00 2001
From: Sibo Dong <46512211+dongsibo@users.noreply.github.com>
Date: Wed, 2 Feb 2022 19:18:02 +0900
Subject: [PATCH] ui/gtk3: Update man page for Emoji shortcut key
The default Emoji shortcut key was changed but not updated in
the ibus-emoji.7 man page.
BUG=https://github.com/ibus/ibus/pull/2353
---
ui/gtk3/ibus-emoji.7.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/gtk3/ibus-emoji.7.in b/ui/gtk3/ibus-emoji.7.in
index 9c6d3c6f..b4d941ec 100644
--- a/ui/gtk3/ibus-emoji.7.in
+++ b/ui/gtk3/ibus-emoji.7.in
@@ -1,8 +1,8 @@
.\" This file is distributed under the same license as the ibus
.\" package.
-.\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2017-2018.
+.\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2017-2022.
.\"
-.TH "IBUS EMOJI" 7 "August 2018" "@VERSION@" "User Commands"
+.TH "IBUS EMOJI" 7 "February 2022" "@VERSION@" "User Commands"
.SH NAME
.B ibus-emoji
\- Call the IBus emoji utility by
@@ -51,7 +51,7 @@ E.g. "Noto Color Emoji", "Android Emoji" font.
.SH "KEYBOARD OPERATIONS"
.TP
-\fBControl-Shift-e\fR
+\fBControl-Period or Control-Semicolon\fR
Launch IBus Emojier. The shortcut key can be customized by
.B ibus\-setup (1).
.TP
--
2.33.1
From 0f1485bfa687386f26ef5909c123e0ae2e3e11b9 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 3 Feb 2022 14:03:30 +0900
Subject: [PATCH] src: Add IBUS_INPUT_HINT_PRIVATE for browser private mode
GTK4 added GTK_INPUT_HINT_PRIVATE recently for Web brower
private or guest mode.
BUG=https://github.com/ibus/ibus/issues/2315
---
src/ibustypes.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ibustypes.h b/src/ibustypes.h
index 798ad04d..990659ac 100644
--- a/src/ibustypes.h
+++ b/src/ibustypes.h
@@ -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-2020 Red Hat, Inc.
+ * Copyright (C) 2010-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2022 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
@@ -300,6 +301,8 @@ typedef enum
* @IBUS_INPUT_HINT_VERTICAL_WRITING: The text is vertical. Since 1.5.11
* @IBUS_INPUT_HINT_EMOJI: Suggest offering Emoji support. Since 1.5.24
* @IBUS_INPUT_HINT_NO_EMOJI: Suggest not offering Emoji support. Since 1.5.24
+ * @IBUS_INPUT_HINT_PRIVATE: Request that the input method should not
+ * update personalized data (like typing history). Since 1.5.26
*
* Describes hints that might be taken into account by engines. Note
* that engines may already tailor their behaviour according to the
@@ -326,7 +329,8 @@ typedef enum
IBUS_INPUT_HINT_INHIBIT_OSK = 1 << 7,
IBUS_INPUT_HINT_VERTICAL_WRITING = 1 << 8,
IBUS_INPUT_HINT_EMOJI = 1 << 9,
- IBUS_INPUT_HINT_NO_EMOJI = 1 << 10
+ IBUS_INPUT_HINT_NO_EMOJI = 1 << 10,
+ IBUS_INPUT_HINT_PRIVATE = 1 << 11
} IBusInputHints;
#endif
--
2.33.1
From 787b564982d17017cb35ab87b71b6a16d7440387 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 3 Feb 2022 14:34:34 +0900
Subject: [PATCH] bus: mkdir socket dirs instead of socket paths
IBus ran mkdir for socket paths for --address=unix:path
but should does the socket directories instead.
BUG=https://github.com/ibus/ibus/issues/2363
---
bus/server.c | 39 +++++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/bus/server.c b/bus/server.c
index e8d0ce2b..6abf8427 100644
--- a/bus/server.c
+++ b/bus/server.c
@@ -2,7 +2,7 @@
/* vim:set et sts=4: */
/* bus - The Input Bus
* Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2011-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2011-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
* Copyright (C) 2008-2021 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -38,14 +38,14 @@ static GDBusServer *server = NULL;
static GMainLoop *mainloop = NULL;
static BusDBusImpl *dbus = NULL;
static BusIBusImpl *ibus = NULL;
-static gchar *address = NULL;
+static char *address = NULL;
static gboolean _restart = FALSE;
static void
_restart_server (void)
{
- gchar *exe;
- gint fd;
+ char *exe;
+ int fd;
ssize_t r;
int MAXSIZE = 0xFFF;
char proclnk[MAXSIZE];
@@ -201,11 +201,11 @@ bus_acquired_handler (GDBusConnection *connection,
NULL);
}
-static gchar *
+static char *
_bus_extract_address (void)
{
- gchar *socket_address = g_strdup (g_address);
- gchar *p;
+ char *socket_address = g_strdup (g_address);
+ char *p;
#define IF_REPLACE_VARIABLE_WITH_FUNC(variable, func, format) \
if ((p = g_strstr_len (socket_address, -1, (variable)))) { \
@@ -242,12 +242,12 @@ bus_server_init (void)
#define IBUS_UNIX_ABSTRACT "unix:abstract="
#define IBUS_UNIX_DIR "unix:dir="
- gchar *socket_address;
+ char *socket_address;
GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_NONE;
- gchar *guid;
+ char *guid;
GDBusAuthObserver *observer;
GError *error = NULL;
- gchar *unix_dir = NULL;
+ char *unix_dir = NULL;
dbus = bus_dbus_impl_get_default ();
ibus = bus_ibus_impl_get_default ();
@@ -256,18 +256,24 @@ bus_server_init (void)
/* init server */
socket_address = _bus_extract_address ();
-#define IF_GET_UNIX_DIR(prefix) \
+#define IF_GET_UNIX_DIR_FROM_DIR(prefix) \
if (g_str_has_prefix (socket_address, (prefix))) { \
unix_dir = g_strdup (socket_address + strlen (prefix)); \
}
+#define IF_GET_UNIX_DIR_FROM_PATH(prefix) \
+ if (g_str_has_prefix (socket_address, (prefix))) { \
+ const char *unix_path = socket_address + strlen (prefix); \
+ unix_dir = g_path_get_dirname (unix_path); \
+ }
+
- IF_GET_UNIX_DIR (IBUS_UNIX_TMPDIR)
+ IF_GET_UNIX_DIR_FROM_DIR (IBUS_UNIX_TMPDIR)
else
- IF_GET_UNIX_DIR (IBUS_UNIX_PATH)
+ IF_GET_UNIX_DIR_FROM_PATH (IBUS_UNIX_PATH)
else
- IF_GET_UNIX_DIR (IBUS_UNIX_ABSTRACT)
+ IF_GET_UNIX_DIR_FROM_PATH (IBUS_UNIX_ABSTRACT)
else
- IF_GET_UNIX_DIR (IBUS_UNIX_DIR)
+ IF_GET_UNIX_DIR_FROM_DIR (IBUS_UNIX_DIR)
else {
g_error ("Your socket address \"%s\" does not correspond with "
"one of the following formats; "
@@ -329,7 +335,8 @@ bus_server_init (void)
bus_acquired_handler,
NULL, NULL, NULL, NULL);
-#undef IF_GET_UNIX_DIR
+#undef IF_GET_UNIX_DIR_FROM_DIR
+#undef IF_GET_UNIX_DIR_FROM_PATH
#undef IBUS_UNIX_TMPDIR
#undef IBUS_UNIX_PATH
#undef IBUS_UNIX_ABSTRACT
--
2.33.1
From 3abcb19619750e242e1641c1c443fb460f055289 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Tue, 18 Jan 2022 17:03:53 +0900

View File

@ -39,7 +39,7 @@
Name: ibus
Version: 1.5.25
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
URL: https://github.com/ibus/%name/wiki
@ -517,6 +517,14 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
* Thu Feb 03 2022 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.25-9
- Change XKB layout string color in panel
- Add Ctrl-semicolon to Emoji shortcut key
- Fix unref problems with floating references
- Update man page for Emoji shortcut key
- Add IBUS_INPUT_HINT_PRIVATE for browser private mode
- mkdir socket dirs instead of socket paths
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.25-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild