[gtk+] Update IM spot location before running _validate_onscreen()



commit 3a917a2a677b02b587a44b7157231418508faa5e
Author: Kristian Rietveld <kris gtk org>
Date:   Fri Sep 4 13:30:48 2009 +0200

    Update IM spot location before running _validate_onscreen()
    
    Updating the IM spot location in gtk_text_view_value_changed() might
    invalidate the layout, so we need to make sure that we update it before
    validating the layout again.  Otherwise, the layout will be invalidated
    right after validating it (possibly resulting in a failed
    onscreen_validated assertion).  Patch merged from maemo-gtk.

 gtk/gtktextview.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 18da865..4c5f0d2 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -7196,6 +7196,11 @@ gtk_text_view_value_changed (GtkAdjustment *adj,
    */
   gtk_text_view_update_layout_width (text_view);
   
+  /* We also update the IM spot location here, since the IM context
+   * might do something that leads to validation.
+   */
+  gtk_text_view_update_im_spot_location (text_view);
+
   /* note that validation of onscreen could invoke this function
    * recursively, by scrolling to maintain first_para, or in response
    * to updating the layout width, however there is no problem with
@@ -7230,6 +7235,9 @@ gtk_text_view_value_changed (GtkAdjustment *adj,
       text_view->first_validate_idle = 0;
     }
 
+  /* Finally we update the IM cursor location again, to ensure any
+   * changes made by the validation are pushed through.
+   */
   gtk_text_view_update_im_spot_location (text_view);
   
   DV(g_print(">End scroll offset changed handler ("G_STRLOC")\n"));



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