summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--ChangeLog.pre-2-014
-rw-r--r--ChangeLog.pre-2-1014
-rw-r--r--ChangeLog.pre-2-214
-rw-r--r--ChangeLog.pre-2-414
-rw-r--r--ChangeLog.pre-2-614
-rw-r--r--ChangeLog.pre-2-814
-rw-r--r--gtk/gtkimmulticontext.c14
-rw-r--r--modules/input/gtkimcontextxim.c49
-rw-r--r--modules/input/gtkimcontextxim.h2
10 files changed, 159 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b04af65e89..13917d55dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index b04af65e89..13917d55dc 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,17 @@
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index b04af65e89..13917d55dc 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,17 @@
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index b04af65e89..13917d55dc 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,17 @@
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index b04af65e89..13917d55dc 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,17 @@
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index b04af65e89..13917d55dc 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,17 @@
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index b04af65e89..13917d55dc 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,17 @@
+Fri Nov 2 15:30:34 2001 Owen Taylor <otaylor@redhat.com>
+
+ Patch from HideToshi Tajima (#51922)
+
+ * gtk/gtkimmulticontext.c: Proxy set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: Implement
+ set_use_preedit().
+
+ * gtk/modules/input/gtkimcontextxim.[ch]: If we have
+ to destroy the input context because we change the
+ client window or use_preedit, make sure we empty
+ the preedit string.
+
Fri Nov 2 14:55:53 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcolorseldialog.c,gtkfilesel.c,gtkfontsel.c,
diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c
index 4d4cce66ba..ea51bab2d1 100644
--- a/gtk/gtkimmulticontext.c
+++ b/gtk/gtkimmulticontext.c
@@ -45,6 +45,8 @@ static void gtk_im_multicontext_focus_out (GtkIMContext
static void gtk_im_multicontext_reset (GtkIMContext *context);
static void gtk_im_multicontext_set_cursor_location (GtkIMContext *context,
GdkRectangle *area);
+static void gtk_im_multicontext_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit);
static gboolean gtk_im_multicontext_get_surrounding (GtkIMContext *context,
gchar **text,
gint *cursor_index);
@@ -115,6 +117,7 @@ gtk_im_multicontext_class_init (GtkIMMulticontextClass *class)
im_context_class->focus_out = gtk_im_multicontext_focus_out;
im_context_class->reset = gtk_im_multicontext_reset;
im_context_class->set_cursor_location = gtk_im_multicontext_set_cursor_location;
+ im_context_class->set_use_preedit = gtk_im_multicontext_set_use_preedit;
im_context_class->set_surrounding = gtk_im_multicontext_set_surrounding;
im_context_class->get_surrounding = gtk_im_multicontext_get_surrounding;
@@ -321,6 +324,17 @@ gtk_im_multicontext_set_cursor_location (GtkIMContext *context,
gtk_im_context_set_cursor_location (slave, area);
}
+static void
+gtk_im_multicontext_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit)
+{
+ GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
+ GtkIMContext *slave = gtk_im_multicontext_get_slave (multicontext);
+
+ if (slave)
+ gtk_im_context_set_use_preedit (slave, use_preedit);
+}
+
static gboolean
gtk_im_multicontext_get_surrounding (GtkIMContext *context,
gchar **text,
diff --git a/modules/input/gtkimcontextxim.c b/modules/input/gtkimcontextxim.c
index 1285103d40..2f5faeb3b1 100644
--- a/modules/input/gtkimcontextxim.c
+++ b/modules/input/gtkimcontextxim.c
@@ -42,6 +42,8 @@ static void gtk_im_context_xim_focus_in (GtkIMContext *co
static void gtk_im_context_xim_focus_out (GtkIMContext *context);
static void gtk_im_context_xim_set_cursor_location (GtkIMContext *context,
GdkRectangle *area);
+static void gtk_im_context_xim_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit);
static void gtk_im_context_xim_get_preedit_string (GtkIMContext *context,
gchar **str,
PangoAttrList **attrs,
@@ -216,12 +218,14 @@ gtk_im_context_xim_class_init (GtkIMContextXIMClass *class)
im_context_class->focus_in = gtk_im_context_xim_focus_in;
im_context_class->focus_out = gtk_im_context_xim_focus_out;
im_context_class->set_cursor_location = gtk_im_context_xim_set_cursor_location;
+ im_context_class->set_use_preedit = gtk_im_context_xim_set_use_preedit;
gobject_class->finalize = gtk_im_context_xim_finalize;
}
static void
gtk_im_context_xim_init (GtkIMContextXIM *im_context_xim)
{
+ im_context_xim->use_preedit = TRUE;
}
static void
@@ -239,17 +243,28 @@ gtk_im_context_xim_finalize (GObject *obj)
}
static void
-gtk_im_context_xim_set_client_window (GtkIMContext *context,
- GdkWindow *client_window)
+reinitialize_ic (GtkIMContextXIM *context_xim)
{
- GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
-
if (context_xim->ic)
{
XDestroyIC (context_xim->ic);
context_xim->ic = NULL;
+
+ if (context_xim->preedit_length)
+ {
+ context_xim->preedit_length = 0;
+ g_signal_emit_by_name (context_xim, "preedit_changed");
+ }
}
+}
+static void
+gtk_im_context_xim_set_client_window (GtkIMContext *context,
+ GdkWindow *client_window)
+{
+ GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
+
+ reinitialize_ic (context_xim);
context_xim->client_window = client_window;
}
@@ -426,6 +441,23 @@ gtk_im_context_xim_set_cursor_location (GtkIMContext *context,
}
static void
+gtk_im_context_xim_set_use_preedit (GtkIMContext *context,
+ gboolean use_preedit)
+{
+ GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
+
+ use_preedit = use_preedit != FALSE;
+
+ if (context_xim->use_preedit != use_preedit)
+ {
+ context_xim->use_preedit = use_preedit;
+ reinitialize_ic (context_xim);
+ }
+
+ return;
+}
+
+static void
gtk_im_context_xim_reset (GtkIMContext *context)
{
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
@@ -784,6 +816,15 @@ gtk_im_context_xim_get_ic (GtkIMContextXIM *context_xim)
if (!context_xim->ic && context_xim->client_window)
{
+ if (!context_xim->use_preedit)
+ {
+ context_xim->ic = XCreateIC (context_xim->im_info->im,
+ XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+ XNClientWindow, GDK_DRAWABLE_XID (context_xim->client_window),
+ NULL);
+ return context_xim->ic;
+ }
+
if ((context_xim->im_info->style & PREEDIT_MASK) == XIMPreeditCallbacks)
{
context_xim->preedit_start_callback.client_data = (XPointer)context_xim;
diff --git a/modules/input/gtkimcontextxim.h b/modules/input/gtkimcontextxim.h
index 7d276acd67..96d1df5eed 100644
--- a/modules/input/gtkimcontextxim.h
+++ b/modules/input/gtkimcontextxim.h
@@ -70,6 +70,8 @@ struct _GtkIMContextXIM
XIMCallback status_draw_callback;
XIC ic;
+
+ guint use_preedit : 1;
};
struct _GtkIMContextXIMClass