diff options
author | Chris Toshok <toshok@ximian.com> | 2003-04-03 14:44:40 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-04-03 14:44:40 +0800 |
commit | edc0d3e040c037689cf6fb1c7fca70becf3e4f61 (patch) | |
tree | 8abc95a32542f45d3d79635e6fe2a5c01b1afa44 /widgets | |
parent | 049c9cdaca332f110e8f692806efd101e62e2381 (diff) | |
download | gsoc2013-evolution-edc0d3e040c037689cf6fb1c7fca70becf3e4f61.tar gsoc2013-evolution-edc0d3e040c037689cf6fb1c7fca70becf3e4f61.tar.gz gsoc2013-evolution-edc0d3e040c037689cf6fb1c7fca70becf3e4f61.tar.bz2 gsoc2013-evolution-edc0d3e040c037689cf6fb1c7fca70becf3e4f61.tar.lz gsoc2013-evolution-edc0d3e040c037689cf6fb1c7fca70becf3e4f61.tar.xz gsoc2013-evolution-edc0d3e040c037689cf6fb1c7fca70becf3e4f61.tar.zst gsoc2013-evolution-edc0d3e040c037689cf6fb1c7fca70becf3e4f61.zip |
only connect the signals if !im_context_signals_registered. (e_text_init):
2003-04-02 Chris Toshok <toshok@ximian.com>
* gal/e-text/e-text.c (e_text_event): only connect the signals if
!im_context_signals_registered.
(e_text_init): init im_context_signals_registered = FALSE.
* gal/e-text/e-text.c (struct _EText): add
im_context_signals_registered.
svn path=/trunk/; revision=20656
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/text/e-text.c | 19 | ||||
-rw-r--r-- | widgets/text/e-text.h | 1 |
2 files changed, 13 insertions, 7 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 278cf72a0c..2800baac3e 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -134,7 +134,6 @@ static gboolean show_pango_rectangle (EText *text, PangoRectangle rect); static void e_text_do_popup (EText *text, GdkEventButton *button, int position); static void e_text_update_primary_selection (EText *text); -static void e_text_delete_selection(EText *text); static void e_text_paste (EText *text, GdkAtom selection); static void e_text_insert(EText *text, const char *string, int value); @@ -2090,12 +2089,15 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) focus_event = (GdkEventFocus *) event; if (focus_event->in) { if (text->im_context) { - g_signal_connect (text->im_context, "commit", - G_CALLBACK (e_text_commit_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); + 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, "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 */ @@ -2105,6 +2107,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, text); + text->im_context_signals_registered = FALSE; } e_text_stop_editing (text); if (text->timeout_id) { @@ -3455,6 +3458,8 @@ e_text_init (EText *text) text->im_context = NULL; text->need_im_reset = FALSE; + text->im_context_signals_registered = FALSE; + e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(text), e_text_reflow); } diff --git a/widgets/text/e-text.h b/widgets/text/e-text.h index bff45111f9..c40dad4ea3 100644 --- a/widgets/text/e-text.h +++ b/widgets/text/e-text.h @@ -214,6 +214,7 @@ struct _EText { GtkIMContext *im_context; gboolean need_im_reset; + gboolean im_context_signals_registered; }; struct _ETextClass { |