mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 06:00:22 +00:00
Merge branch 'shorter-im-context-ids' into 'main'
immmodule: Warn if GTK_IM_MODULE is bad See merge request GNOME/gtk!5229
This commit is contained in:
commit
4a71957c1f
@ -66,8 +66,10 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#define SIMPLE_ID "gtk-im-context-simple"
|
||||
#define NONE_ID "gtk-im-context-none"
|
||||
#define SIMPLE_ID "gtk-im-context-simple"
|
||||
#define ALT_SIMPLE_ID "simple"
|
||||
#define NONE_ID "gtk-im-context-none"
|
||||
#define ALT_NONE_ID "none"
|
||||
|
||||
/**
|
||||
* _gtk_im_module_create:
|
||||
@ -151,9 +153,11 @@ lookup_immodule (GdkDisplay *display,
|
||||
if (!match_backend (display, immodules_list[i]))
|
||||
continue;
|
||||
|
||||
if (g_strcmp0 (immodules_list[i], SIMPLE_ID) == 0)
|
||||
if (g_strcmp0 (immodules_list[i], SIMPLE_ID) == 0 ||
|
||||
g_strcmp0 (immodules_list[i], ALT_SIMPLE_ID) == 0)
|
||||
return SIMPLE_ID;
|
||||
else if (g_strcmp0 (immodules_list[i], NONE_ID) == 0)
|
||||
else if (g_strcmp0 (immodules_list[i], NONE_ID) == 0 ||
|
||||
g_strcmp0 (immodules_list[i], ALT_NONE_ID) == 0)
|
||||
return NONE_ID;
|
||||
else
|
||||
{
|
||||
@ -199,6 +203,16 @@ _gtk_im_module_get_default_context_id (GdkDisplay *display)
|
||||
|
||||
if (context_id)
|
||||
return context_id;
|
||||
else
|
||||
{
|
||||
static gboolean warned;
|
||||
|
||||
if (!warned)
|
||||
{
|
||||
g_warning ("No IM module matching GTK_IM_MODULE=%s found", envvar);
|
||||
warned = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if the certain immodule is set in XSETTINGS. */
|
||||
|
Loading…
Reference in New Issue
Block a user