X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkimmulticontext.c;h=2b887b9607c1597b836b114e392ecae9218e8ac8;hb=73858490145a88443f1e02cd55a1e6f9312bb01a;hp=ea471a8aaf3ed0d7b2a25a741cf422a343debd87;hpb=c7514e8f0d19a833257497caff413bb4dfae6eb4;p=~andy%2Fgtk diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c index ea471a8aa..2b887b960 100644 --- a/gtk/gtkimmulticontext.c +++ b/gtk/gtkimmulticontext.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -23,11 +21,14 @@ #include #include "gtkimmulticontext.h" -#include "gtkimmodule.h" +#include "gtkimmoduleprivate.h" +#include "gtkintl.h" +#include "gtklabel.h" #include "gtkmain.h" +#include "gtkprivate.h" #include "gtkradiomenuitem.h" -#include "gtkintl.h" -#include "gtkprivate.h" /* To get redefinition of GTK_LOCALE_DIR on Win32 */ +#include "gtkseparatormenuitem.h" +#include "gtksettings.h" /** @@ -348,24 +349,38 @@ gtk_im_multicontext_filter_keypress (GtkIMContext *context, GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext); if (slave) - return gtk_im_context_filter_keypress (slave, event); - else if (event->type == GDK_KEY_PRESS && - (event->state & (GDK_MOD1_MASK | GDK_CONTROL_MASK)) == 0) { - gunichar ch; + return gtk_im_context_filter_keypress (slave, event); + } + else + { + GdkDisplay *display; + GdkModifierType no_text_input_mask; + + display = gdk_window_get_display (event->window); - ch = gdk_keyval_to_unicode (event->keyval); - if (ch != 0 && !g_unichar_iscntrl (ch)) + no_text_input_mask = + gdk_keymap_get_modifier_mask (gdk_keymap_get_for_display (display), + GDK_MODIFIER_INTENT_NO_TEXT_INPUT); + + if (event->type == GDK_KEY_PRESS && + (event->state & no_text_input_mask) == 0) { - gint len; - gchar buf[10]; + gunichar ch; + + ch = gdk_keyval_to_unicode (event->keyval); + if (ch != 0 && !g_unichar_iscntrl (ch)) + { + gint len; + gchar buf[10]; - len = g_unichar_to_utf8 (ch, buf); - buf[len] = '\0'; + len = g_unichar_to_utf8 (ch, buf); + buf[len] = '\0'; - g_signal_emit_by_name (multicontext, "commit", buf); + g_signal_emit_by_name (multicontext, "commit", buf); - return TRUE; + return TRUE; + } } } @@ -620,7 +635,7 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context, { /* Same translation domain as GTK+ */ if (!(contexts[i]->domain_dirname && contexts[i]->domain_dirname[0]) || - pathnamecmp (contexts[i]->domain_dirname, GTK_LOCALEDIR) == 0) + pathnamecmp (contexts[i]->domain_dirname, _gtk_get_localedir ()) == 0) { /* Empty or NULL, domain directory, or same as * GTK+. Input method may have a name in the GTK+