[gedit] Use new accessor for gtk_text_view_reset_im_context.



commit db4f95e850089d89077a5f49c249c4d4322bb22d
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sun May 16 12:51:33 2010 +0200

    Use new accessor for gtk_text_view_reset_im_context.

 gedit/gedit-view.c       |   13 +------------
 gedit/gseal-gtk-compat.h |    9 +++++++++
 2 files changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/gedit/gedit-view.c b/gedit/gedit-view.c
index 54f9712..c2d4f6e 100644
--- a/gedit/gedit-view.c
+++ b/gedit/gedit-view.c
@@ -2113,17 +2113,6 @@ search_highlight_updated_cb (GeditDocument *doc,
 	}
 }
 
-/* There is no "official" way to reset the im context in GtkTextView */
-static void
-reset_im_context (GtkTextView *text_view)
-{
-	if (text_view->need_im_reset)
-	{
-		text_view->need_im_reset = FALSE;
-		gtk_im_context_reset (text_view->im_context);
-	}
-}
-
 static void
 delete_line (GtkTextView *text_view,
 	     gint         count)
@@ -2134,7 +2123,7 @@ delete_line (GtkTextView *text_view,
 
 	buffer = gtk_text_view_get_buffer (text_view);
 
-	reset_im_context (text_view);
+	gtk_text_view_reset_im_context (text_view);
 
 	/* If there is a selection delete the selected lines and
 	 * ignore count */
diff --git a/gedit/gseal-gtk-compat.h b/gedit/gseal-gtk-compat.h
index b8b697d..1900f29 100644
--- a/gedit/gseal-gtk-compat.h
+++ b/gedit/gseal-gtk-compat.h
@@ -23,6 +23,15 @@
 
 G_BEGIN_DECLS
 
+#if !GTK_CHECK_VERSION (2, 22, 0)
+#define gtk_text_view_reset_im_context(view) \
+	if (GTK_TEXT_VIEW (view)->need_im_reset) \
+	{ \
+		GTK_TEXT_VIEW (view)->need_im_reset = FALSE; \
+		gtk_im_context_reset (GTK_TEXT_VIEW (view)->im_context); \
+	}
+#endif /* GTK < 2.22.0 */
+
 #if !GTK_CHECK_VERSION (2, 20, 0)
 #define gtk_widget_get_realized(widget)                         GTK_WIDGET_REALIZED(widget)
 #define gtk_widget_get_mapped(widget)                           GTK_WIDGET_MAPPED(widget)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]