mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
Reset the existing slave before removing it to give it a chance to commit
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave): Reset the existing slave before removing it to give it a chance to commit and emit "preedit_changed" in case there was still a preedit string.
This commit is contained in:
parent
43851fe034
commit
9a25f879ab
@ -1,3 +1,10 @@
|
||||
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave):
|
||||
Reset the existing slave before removing it to give
|
||||
it a chance to commit and emit "preedit_changed"
|
||||
in case there was still a preedit string.
|
||||
|
||||
2001-12-12 Matthias Clasen <matthiasc@poet.de>
|
||||
|
||||
* gtk/gtktextlayout.c: Typo fixes
|
||||
|
@ -1,3 +1,10 @@
|
||||
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave):
|
||||
Reset the existing slave before removing it to give
|
||||
it a chance to commit and emit "preedit_changed"
|
||||
in case there was still a preedit string.
|
||||
|
||||
2001-12-12 Matthias Clasen <matthiasc@poet.de>
|
||||
|
||||
* gtk/gtktextlayout.c: Typo fixes
|
||||
|
@ -1,3 +1,10 @@
|
||||
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave):
|
||||
Reset the existing slave before removing it to give
|
||||
it a chance to commit and emit "preedit_changed"
|
||||
in case there was still a preedit string.
|
||||
|
||||
2001-12-12 Matthias Clasen <matthiasc@poet.de>
|
||||
|
||||
* gtk/gtktextlayout.c: Typo fixes
|
||||
|
@ -1,3 +1,10 @@
|
||||
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave):
|
||||
Reset the existing slave before removing it to give
|
||||
it a chance to commit and emit "preedit_changed"
|
||||
in case there was still a preedit string.
|
||||
|
||||
2001-12-12 Matthias Clasen <matthiasc@poet.de>
|
||||
|
||||
* gtk/gtktextlayout.c: Typo fixes
|
||||
|
@ -1,3 +1,10 @@
|
||||
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave):
|
||||
Reset the existing slave before removing it to give
|
||||
it a chance to commit and emit "preedit_changed"
|
||||
in case there was still a preedit string.
|
||||
|
||||
2001-12-12 Matthias Clasen <matthiasc@poet.de>
|
||||
|
||||
* gtk/gtktextlayout.c: Typo fixes
|
||||
|
@ -1,3 +1,10 @@
|
||||
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave):
|
||||
Reset the existing slave before removing it to give
|
||||
it a chance to commit and emit "preedit_changed"
|
||||
in case there was still a preedit string.
|
||||
|
||||
2001-12-12 Matthias Clasen <matthiasc@poet.de>
|
||||
|
||||
* gtk/gtktextlayout.c: Typo fixes
|
||||
|
@ -1,3 +1,10 @@
|
||||
Wed Dec 12 17:22:45 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gtk/gtkimmulticontext.c (gtk_im_multicontext_set_slave):
|
||||
Reset the existing slave before removing it to give
|
||||
it a chance to commit and emit "preedit_changed"
|
||||
in case there was still a preedit string.
|
||||
|
||||
2001-12-12 Matthias Clasen <matthiasc@poet.de>
|
||||
|
||||
* gtk/gtktextlayout.c: Typo fixes
|
||||
|
@ -30,7 +30,8 @@ static void gtk_im_multicontext_init (GtkIMMulticontext
|
||||
static void gtk_im_multicontext_finalize (GObject *object);
|
||||
|
||||
static void gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
|
||||
GtkIMContext *slave);
|
||||
GtkIMContext *slave,
|
||||
gboolean finalizing);
|
||||
|
||||
static void gtk_im_multicontext_set_client_window (GtkIMContext *context,
|
||||
GdkWindow *window);
|
||||
@ -146,17 +147,21 @@ gtk_im_multicontext_new (void)
|
||||
static void
|
||||
gtk_im_multicontext_finalize (GObject *object)
|
||||
{
|
||||
gtk_im_multicontext_set_slave (GTK_IM_MULTICONTEXT (object), NULL);
|
||||
gtk_im_multicontext_set_slave (GTK_IM_MULTICONTEXT (object), NULL, TRUE);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
|
||||
GtkIMContext *slave)
|
||||
GtkIMContext *slave,
|
||||
gboolean finalizing)
|
||||
{
|
||||
if (multicontext->slave)
|
||||
{
|
||||
if (!finalizing)
|
||||
gtk_im_context_reset (multicontext->slave);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (multicontext->slave,
|
||||
gtk_im_multicontext_preedit_start_cb,
|
||||
multicontext);
|
||||
@ -171,6 +176,10 @@ gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
|
||||
multicontext);
|
||||
|
||||
g_object_unref (multicontext->slave);
|
||||
multicontext->slave = NULL;
|
||||
|
||||
if (!finalizing)
|
||||
g_signal_emit_by_name (multicontext, "preedit_changed");
|
||||
}
|
||||
|
||||
multicontext->slave = slave;
|
||||
@ -220,7 +229,7 @@ gtk_im_multicontext_get_slave (GtkIMMulticontext *multicontext)
|
||||
global_context_id = _gtk_im_module_get_default_context_id (locale);
|
||||
}
|
||||
|
||||
gtk_im_multicontext_set_slave (multicontext, _gtk_im_module_create (global_context_id));
|
||||
gtk_im_multicontext_set_slave (multicontext, _gtk_im_module_create (global_context_id), FALSE);
|
||||
multicontext->context_id = global_context_id;
|
||||
}
|
||||
|
||||
@ -285,7 +294,7 @@ gtk_im_multicontext_focus_in (GtkIMContext *context)
|
||||
*/
|
||||
if (!multicontext->context_id ||
|
||||
strcmp (global_context_id, multicontext->context_id) != 0)
|
||||
gtk_im_multicontext_set_slave (multicontext, NULL);
|
||||
gtk_im_multicontext_set_slave (multicontext, NULL, FALSE);
|
||||
|
||||
slave = gtk_im_multicontext_get_slave (multicontext);
|
||||
|
||||
@ -434,7 +443,7 @@ activate_cb (GtkWidget *menuitem,
|
||||
gtk_im_context_reset (GTK_IM_CONTEXT (context));
|
||||
|
||||
global_context_id = id;
|
||||
gtk_im_multicontext_set_slave (context, NULL);
|
||||
gtk_im_multicontext_set_slave (context, NULL, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user