[uim-commit] r517 - trunk/gtk
tkng at freedesktop.org
tkng at freedesktop.org
Fri Feb 4 02:35:35 PST 2005
Author: tkng
Date: 2005-02-04 02:35:30 -0800 (Fri, 04 Feb 2005)
New Revision: 517
Modified:
trunk/gtk/gtk-im-uim.c
Log:
* gtk/gtk-im-uim.c:
-(filter_keypress): Call uim_press/release_key if snooper is not installed.
Modified: trunk/gtk/gtk-im-uim.c
===================================================================
--- trunk/gtk/gtk-im-uim.c 2005-02-04 09:21:45 UTC (rev 516)
+++ trunk/gtk/gtk-im-uim.c 2005-02-04 10:35:30 UTC (rev 517)
@@ -279,6 +279,25 @@
GdkEventKey *key)
{
IMUIMContext *uic = IM_UIM_CONTEXT(ic);
+
+ /*** Hack for combination of xchat + GTK+ 2.6 ***/
+ if (snooper_installed == FALSE) {
+ int rv;
+ int kv = convert_keyval(key->keyval);
+ int mod = convert_modifier(key->state);
+
+ if (key->type == GDK_KEY_RELEASE) {
+ rv = uim_release_key(focused_context->uc, kv, mod);
+ } else {
+ rv = uim_press_key(focused_context->uc, kv, mod);
+ }
+ if (rv) {
+ return gtk_im_context_filter_keypress(uic->slave, key);
+ }
+ return TRUE;
+ }
+ /*** Hack for combination of xchat + GTK+ 2.6 ***/
+
return gtk_im_context_filter_keypress(uic->slave, key);
}
@@ -448,7 +467,7 @@
focused_context = uic;
disable_focused_context = FALSE;
- /* XXX:This is not recommended way!! */
+ /* XXX:Use of key snooper is not recommended way!! */
if(snooper_installed == FALSE) {
snooper_id = gtk_key_snooper_install((GtkKeySnoopFunc)uim_key_snoop, NULL );
snooper_installed = TRUE;
@@ -728,7 +747,6 @@
g_string_append(msg, "\t");
if(strcmp(name, current_im_name) == 0) {
g_string_append(msg, "selected");
- g_print("%s has been selected\n", name);
}
g_string_append(msg, "\n");
}
@@ -832,7 +850,6 @@
obj = g_object_new(type_im_uim, NULL);
uic = IM_UIM_CONTEXT(obj);
-
im_name = uim_get_default_im_name(setlocale(LC_CTYPE, NULL));
uic->uc = uim_create_context(uic, "UTF-8",
NULL, im_name,
@@ -994,6 +1011,7 @@
}
return TRUE;
}
+
return FALSE;
}
More information about the Uim-commit
mailing list