Accepting request 89707 from GNOME:Factory
Fix bnc#723382 (forwarded request 89705 from vuntz) OBS-URL: https://build.opensuse.org/request/show/89707 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gtk3?expand=0&rev=27
This commit is contained in:
commit
c79f1ec1a4
81
gtk3-immodule-fallback.patch
Normal file
81
gtk3-immodule-fallback.patch
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
|
||||||
|
index 593a868..c5bd139 100644
|
||||||
|
--- a/gtk/gtkimmodule.c
|
||||||
|
+++ b/gtk/gtkimmodule.c
|
||||||
|
@@ -648,6 +648,26 @@ match_locale (const gchar *locale,
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static const gchar *
|
||||||
|
+lookup_immodule (gchar **immodules_list)
|
||||||
|
+{
|
||||||
|
+ while (immodules_list && *immodules_list)
|
||||||
|
+ {
|
||||||
|
+ if (g_strcmp0 (*immodules_list, SIMPLE_ID) == 0)
|
||||||
|
+ return SIMPLE_ID;
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ GtkIMModule *module;
|
||||||
|
+ module = g_hash_table_lookup (contexts_hash, *immodules_list);
|
||||||
|
+ if (module)
|
||||||
|
+ return module->contexts[0]->context_id;
|
||||||
|
+ }
|
||||||
|
+ immodules_list++;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return NULL;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* _gtk_im_module_get_default_context_id:
|
||||||
|
* @client_window: a window
|
||||||
|
@@ -664,7 +684,7 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
|
||||||
|
const gchar *context_id = NULL;
|
||||||
|
gint best_goodness = 0;
|
||||||
|
gint i;
|
||||||
|
- gchar *tmp_locale, *tmp;
|
||||||
|
+ gchar *tmp_locale, *tmp, **immodules;
|
||||||
|
const gchar *envvar;
|
||||||
|
GdkScreen *screen;
|
||||||
|
GtkSettings *settings;
|
||||||
|
@@ -672,11 +692,16 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
|
||||||
|
if (!contexts_hash)
|
||||||
|
gtk_im_module_initialize ();
|
||||||
|
|
||||||
|
- envvar = g_getenv ("GTK_IM_MODULE");
|
||||||
|
- if (envvar &&
|
||||||
|
- (strcmp (envvar, SIMPLE_ID) == 0 ||
|
||||||
|
- g_hash_table_lookup (contexts_hash, envvar)))
|
||||||
|
- return envvar;
|
||||||
|
+ envvar = g_getenv("GTK_IM_MODULE");
|
||||||
|
+ if (envvar)
|
||||||
|
+ {
|
||||||
|
+ immodules = g_strsplit(envvar, ":", 0);
|
||||||
|
+ context_id = lookup_immodule(immodules);
|
||||||
|
+ g_strfreev(immodules);
|
||||||
|
+
|
||||||
|
+ if (context_id)
|
||||||
|
+ return context_id;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
/* Check if the certain immodule is set in XSETTINGS.
|
||||||
|
*/
|
||||||
|
@@ -687,15 +712,9 @@ _gtk_im_module_get_default_context_id (GdkWindow *client_window)
|
||||||
|
g_object_get (G_OBJECT (settings), "gtk-im-module", &tmp, NULL);
|
||||||
|
if (tmp)
|
||||||
|
{
|
||||||
|
- if (strcmp (tmp, SIMPLE_ID) == 0)
|
||||||
|
- context_id = SIMPLE_ID;
|
||||||
|
- else
|
||||||
|
- {
|
||||||
|
- GtkIMModule *module;
|
||||||
|
- module = g_hash_table_lookup (contexts_hash, tmp);
|
||||||
|
- if (module)
|
||||||
|
- context_id = module->contexts[0]->context_id;
|
||||||
|
- }
|
||||||
|
+ immodules = g_strsplit(tmp, ":", 0);
|
||||||
|
+ context_id = lookup_immodule(immodules);
|
||||||
|
+ g_strfreev(immodules);
|
||||||
|
g_free (tmp);
|
||||||
|
|
||||||
|
if (context_id)
|
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 28 12:50:50 UTC 2011 - vuntz@opensuse.org
|
||||||
|
|
||||||
|
- Add gtk3-immodule-fallback.patch: make it possible to specify
|
||||||
|
fallback input method modules in the GTK_IM_MODULE environment
|
||||||
|
variable. This is useful in case a module doesn't exist for both
|
||||||
|
gtk2 and gtk3. Fix bnc#723382.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Oct 15 06:16:34 UTC 2011 - vuntz@opensuse.org
|
Sat Oct 15 06:16:34 UTC 2011 - vuntz@opensuse.org
|
||||||
|
|
||||||
|
@ -41,6 +41,8 @@ Patch0: gtk3-GTK_PATH64.patch
|
|||||||
Patch1: gtk3-path-local.patch
|
Patch1: gtk3-path-local.patch
|
||||||
# PATCH-FIX-UPSTREAM gtk3-bnc130159-bgo319483-async-font-selection.patch bnc130159 bgo319483 federico@novell.com - Load fonts asynchronously in GtkFontSelection to make it appear faster for CJK languages
|
# PATCH-FIX-UPSTREAM gtk3-bnc130159-bgo319483-async-font-selection.patch bnc130159 bgo319483 federico@novell.com - Load fonts asynchronously in GtkFontSelection to make it appear faster for CJK languages
|
||||||
Patch3: gtk3-bnc130159-bgo319483-async-font-selection.patch
|
Patch3: gtk3-bnc130159-bgo319483-async-font-selection.patch
|
||||||
|
# PATCH-FEATURE-UPSTREAM gtk3-immodule-fallback.patch bgo#603559 bnc#723382 vuntz@opensuse.org -- Make it possible to specify fallback im modules in GTK_IM_MODULE; useful in case a module doesn't exist for both gtk2 and gtk3
|
||||||
|
Patch4: gtk3-immodule-fallback.patch
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: cups-devel
|
BuildRequires: cups-devel
|
||||||
BuildRequires: pkgconfig(atk) >= 2.1.5
|
BuildRequires: pkgconfig(atk) >= 2.1.5
|
||||||
@ -284,6 +286,7 @@ cp -a %{S:1} .
|
|||||||
%endif
|
%endif
|
||||||
%patch1 -p0
|
%patch1 -p0
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
|
%patch4 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure \
|
%configure \
|
||||||
|
Loading…
Reference in New Issue
Block a user