]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkimmulticontext.c
Assamese translation completed
[~andy/gtk] / gtk / gtkimmulticontext.c
index ea471a8aaf3ed0d7b2a25a741cf422a343debd87..2b887b9607c1597b836b114e392ecae9218e8ac8 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
  */
 
 #include "config.h"
 #include <locale.h>
 
 #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+