]> Pileus Git - ~andy/gtk/commitdiff
Check to see if we've computed our geometry yet, and if not, ignore the
authorOwen Taylor <otaylor@redhat.com>
Fri, 21 Aug 1998 00:13:38 +0000 (00:13 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 21 Aug 1998 00:13:38 +0000 (00:13 +0000)
Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>

* gtk/gtktext.c ([un]draw_cursor): Check to see if we've
computed our geometry yet, and if not, ignore the request.

  gtk/gtktext.c (correct_cache_insert): Fiddled around]
some more. All the bug-test codes seem to work at once
now. (fingers crossed...)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktext.c

index c406187729aaa4e4ab28f5df1cdd3f2caca014b0..c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
+       computed our geometry yet, and if not, ignore the request.
+
+         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       some more. All the bug-test codes seem to work at once
+       now. (fingers crossed...)
+
 Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gdk/gdkrgb.c: silly visual fixes
index c406187729aaa4e4ab28f5df1cdd3f2caca014b0..c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca 100644 (file)
@@ -1,3 +1,12 @@
+Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
+       computed our geometry yet, and if not, ignore the request.
+
+         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       some more. All the bug-test codes seem to work at once
+       now. (fingers crossed...)
+
 Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gdk/gdkrgb.c: silly visual fixes
index c406187729aaa4e4ab28f5df1cdd3f2caca014b0..c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca 100644 (file)
@@ -1,3 +1,12 @@
+Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
+       computed our geometry yet, and if not, ignore the request.
+
+         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       some more. All the bug-test codes seem to work at once
+       now. (fingers crossed...)
+
 Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gdk/gdkrgb.c: silly visual fixes
index c406187729aaa4e4ab28f5df1cdd3f2caca014b0..c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca 100644 (file)
@@ -1,3 +1,12 @@
+Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
+       computed our geometry yet, and if not, ignore the request.
+
+         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       some more. All the bug-test codes seem to work at once
+       now. (fingers crossed...)
+
 Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gdk/gdkrgb.c: silly visual fixes
index c406187729aaa4e4ab28f5df1cdd3f2caca014b0..c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca 100644 (file)
@@ -1,3 +1,12 @@
+Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
+       computed our geometry yet, and if not, ignore the request.
+
+         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       some more. All the bug-test codes seem to work at once
+       now. (fingers crossed...)
+
 Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gdk/gdkrgb.c: silly visual fixes
index c406187729aaa4e4ab28f5df1cdd3f2caca014b0..c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca 100644 (file)
@@ -1,3 +1,12 @@
+Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
+       computed our geometry yet, and if not, ignore the request.
+
+         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       some more. All the bug-test codes seem to work at once
+       now. (fingers crossed...)
+
 Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gdk/gdkrgb.c: silly visual fixes
index c406187729aaa4e4ab28f5df1cdd3f2caca014b0..c1eb6e6bc5f231cfde2f1429b75fc9f61dda15ca 100644 (file)
@@ -1,3 +1,12 @@
+Thu Aug 20 20:08:15 1998  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtktext.c ([un]draw_cursor): Check to see if we've
+       computed our geometry yet, and if not, ignore the request.
+
+         gtk/gtktext.c (correct_cache_insert): Fiddled around]
+       some more. All the bug-test codes seem to work at once
+       now. (fingers crossed...)
+
 Thu Aug 20 13:04:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gdk/gdkrgb.c: silly visual fixes
index e963e203f2dd369c255221d258873a9ae4b83871..2cfed81c596f388fe937ebaff835d44ab24d417e 100644 (file)
@@ -1154,7 +1154,7 @@ gtk_text_realize (GtkWidget *widget)
 #endif
   
   init_properties (text);
-  
+
   gdk_window_show (text->text_area);
   
   if (editable->selection_start_pos != editable->selection_end_pos)
@@ -2484,23 +2484,21 @@ correct_cache_insert (GtkText* text, gint nchars)
   /* If we inserted a property exactly at the beginning of the
    * line, we have to correct here, or fetch_lines will
    * fetch junk.
-   *
-   * This also handles the case when we split exactly
-   *  at the beginning and start->offset is now invalid
    */
-  
   start = &CACHE_DATA(text->current_line).start;
-  if (was_split)
-    {
-      /* If we split exactly at the beginning... */
-      if (start->offset ==  MARK_CURRENT_PROPERTY (start)->length)
-       SET_PROPERTY_MARK (start, start->property->next, 0);
-      /* If we inserted a property at the beginning of the text... */
-      else if ((start->property == text->point.property) &&
-              (start->index == text->point.index - nchars))
-       SET_PROPERTY_MARK (start, start->property->prev, 0);
-    }
-  
+
+  /* Check if if we split exactly at the beginning of the line:
+   * (was_split won't be set if we are inserting at the end of the text, 
+   *  so we don't check)
+   */
+  if (start->offset ==  MARK_CURRENT_PROPERTY (start)->length)
+    SET_PROPERTY_MARK (start, start->property->next, 0);
+  /* Check if we inserted a property at the beginning of the text: */
+  else if (was_split &&
+          (start->property == text->point.property) &&
+          (start->index == text->point.index - nchars))
+    SET_PROPERTY_MARK (start, start->property->prev, 0);
+
   /* Now correct the offsets, and check for start or end marks that
    * are after the point, yet point to a property before the point's
    * property. This indicates that they are meant to point to the
@@ -4621,7 +4619,7 @@ undraw_cursor (GtkText* text, gint absolute)
   
   if ((text->cursor_drawn_level ++ == 0) &&
       (editable->selection_start_pos == editable->selection_end_pos) &&
-      GTK_WIDGET_DRAWABLE (text))
+      GTK_WIDGET_DRAWABLE (text) && text->line_start_cache)
     {
       GdkFont* font;
       
@@ -4702,7 +4700,7 @@ draw_cursor (GtkText* text, gint absolute)
   if ((--text->cursor_drawn_level == 0) &&
       editable->editable &&
       (editable->selection_start_pos == editable->selection_end_pos) &&
-      GTK_WIDGET_DRAWABLE (text))
+      GTK_WIDGET_DRAWABLE (text) && text->line_start_cache)
     {
       GdkFont* font;