diff options
author | Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> | 2004-08-26 12:52:17 +0800 |
---|---|---|
committer | Suresh Chandrasekharan <kcsuresh@src.gnome.org> | 2004-08-26 12:52:17 +0800 |
commit | 033bc219ff1fa637704a96c8983f38b506efc8ff (patch) | |
tree | 5861e86f08d924d1eb0e681be3a0c841c72faa8c | |
parent | 75cc9c38d4354f6f4fb3e896ecf021b4e04419e3 (diff) | |
download | gsoc2013-evolution-033bc219ff1fa637704a96c8983f38b506efc8ff.tar.gz gsoc2013-evolution-033bc219ff1fa637704a96c8983f38b506efc8ff.tar.zst gsoc2013-evolution-033bc219ff1fa637704a96c8983f38b506efc8ff.zip |
Rollback for fix #63731
2004-08-25 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
Rollback for fix #63731
svn path=/trunk/; revision=27028
-rw-r--r-- | widgets/text/e-text.c | 40 | ||||
-rw-r--r-- | widgets/text/e-text.h | 1 |
2 files changed, 24 insertions, 17 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 550089b076..b80228021c 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -961,27 +961,12 @@ e_text_set_property (GObject *object, } case PROP_IM_CONTEXT: - if (text->im_context) { - g_signal_handlers_disconnect_matched (text->im_context, - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, - NULL, text); + if (text->im_context) g_object_unref (text->im_context); - } text->im_context = g_value_get_object (value); - - if (text->im_context) { + if (text->im_context) g_object_ref (text->im_context); - g_signal_connect (text->im_context, "commit", - G_CALLBACK (e_text_commit_cb), text); - g_signal_connect (text->im_context, "preedit_changed", - G_CALLBACK (e_text_preedit_changed_cb), text); - g_signal_connect (text->im_context, "retrieve_surrounding", - G_CALLBACK (e_text_retrieve_surrounding_cb), text); - g_signal_connect (text->im_context, "delete_surrounding", - G_CALLBACK (e_text_delete_surrounding_cb), text); - } text->need_im_reset = FALSE; break; @@ -2194,9 +2179,29 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) GdkEventFocus *focus_event; focus_event = (GdkEventFocus *) event; if (focus_event->in) { + if (text->im_context) { + if (!text->im_context_signals_registered) { + g_signal_connect (text->im_context, "commit", + G_CALLBACK (e_text_commit_cb), text); + g_signal_connect (text->im_context, "preedit_changed", + G_CALLBACK (e_text_preedit_changed_cb), text); + g_signal_connect (text->im_context, "retrieve_surrounding", + G_CALLBACK (e_text_retrieve_surrounding_cb), text); + g_signal_connect (text->im_context, "delete_surrounding", + G_CALLBACK (e_text_delete_surrounding_cb), text); + text->im_context_signals_registered = TRUE; + } + } start_editing (text); text->show_cursor = FALSE; /* so we'll redraw and the cursor will be shown */ } else { + if (text->im_context) { + g_signal_handlers_disconnect_matched (text->im_context, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, + NULL, text); + text->im_context_signals_registered = FALSE; + } e_text_stop_editing (text); if (text->timeout_id) { g_source_remove(text->timeout_id); @@ -3756,6 +3761,7 @@ e_text_init (EText *text) text->im_context = NULL; text->need_im_reset = FALSE; + text->im_context_signals_registered = FALSE; text->handle_popup = FALSE; diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h index a1096cd98b..4eb3fa830b 100644 --- a/widgets/text/e-text.h +++ b/widgets/text/e-text.h @@ -212,6 +212,7 @@ struct _EText { GtkIMContext *im_context; gboolean need_im_reset; + gboolean im_context_signals_registered; gboolean handle_popup; }; |