Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gal/ChangeLog,v
retrieving revision 1.885
diff -u -r1.885 ChangeLog
--- ChangeLog	21 Aug 2004 00:31:04 -0000	1.885
+++ ChangeLog	24 Aug 2004 19:09:45 -0000
@@ -1,3 +1,20 @@
+2004-08-23  Suresh Chandrasekharan <suresh.chandrasekharan@sun.com>
+
+	Bugzilla #63731
+
+	* gal/e-text/e-text.h: Remove unneeded 
+	text->im_context_signals_registered.
+
+	* gal/e-text/e-text.c (e_text_init): Removed 
+	text->im_context_signals_registered
+
+	(e_text_event): Remove text->im_context
+	signals handler connect/disconnect from here.
+	
+	(e_text_set_property): Added them here, now they will be invoked
+	only @ text->im_context creation time, or re-set or at e_text_dispose.
+	Also focus_out events does not affect the signals as they used to.
+
 2004-08-21  Kjartan Maraas  <kmaraas@gnome.org>
 
 	* configure.in: Add «nb» to ALL_LINGUAS.
Index: gal/e-text/e-text.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-text/e-text.c,v
retrieving revision 1.155
diff -u -r1.155 e-text.c
--- gal/e-text/e-text.c	10 Jun 2004 17:01:07 -0000	1.155
+++ gal/e-text/e-text.c	24 Aug 2004 19:09:46 -0000
@@ -961,12 +961,27 @@
 	}
 
 	case PROP_IM_CONTEXT:
-		if (text->im_context)
+		if (text->im_context) {
+			g_signal_handlers_disconnect_matched (text->im_context,
+							     G_SIGNAL_MATCH_DATA,
+							     0, 0, NULL,
+							     NULL, text);
 			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;
@@ -2179,29 +2194,9 @@
 			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);
@@ -3761,7 +3756,6 @@
 
 	text->im_context              = NULL;
 	text->need_im_reset           = FALSE;
-	text->im_context_signals_registered = FALSE;
 
 	text->handle_popup            = FALSE;
 
Index: gal/e-text/e-text.h
===================================================================
RCS file: /cvs/gnome/gal/gal/e-text/e-text.h,v
retrieving revision 1.58
diff -u -r1.58 e-text.h
--- gal/e-text/e-text.h	14 Oct 2003 18:20:18 -0000	1.58
+++ gal/e-text/e-text.h	24 Aug 2004 19:09:46 -0000
@@ -212,7 +212,6 @@
 
 	GtkIMContext *im_context;
 	gboolean      need_im_reset;
-	gboolean      im_context_signals_registered;
 
 	gboolean      handle_popup;
 };
