]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktextlayout.c
When in split cursor mode, always add the cursor as both strong and weak
[~andy/gtk] / gtk / gtktextlayout.c
index 806d147f32165b77c3e9871c41fa810a92539083..b92e85cc8f16abdd9cd88ccb7e09bdf7be8706fd 100644 (file)
@@ -293,6 +293,7 @@ gtk_text_layout_default_style_changed (GtkTextLayout *layout)
 {
   g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
 
+  DV (g_print ("invalidating all due to default style change (%s)\n", G_STRLOC));
   gtk_text_layout_invalidate_all (layout);
 }
 
@@ -335,6 +336,7 @@ gtk_text_layout_set_contexts (GtkTextLayout *layout,
   layout->rtl_context = rtl_context;
   g_object_ref (G_OBJECT (rtl_context));
 
+  DV (g_print ("invalidating all due to new pango contexts (%s)\n", G_STRLOC));
   gtk_text_layout_invalidate_all (layout);
 }
 
@@ -391,6 +393,7 @@ gtk_text_layout_set_screen_width (GtkTextLayout *layout, gint width)
 
   layout->screen_width = width;
 
+  DV (g_print ("invalidating all due to new screen width (%s)\n", G_STRLOC));
   gtk_text_layout_invalidate_all (layout);
 }
 
@@ -919,7 +922,8 @@ gtk_text_layout_real_wrap (GtkTextLayout   *layout,
   GtkTextLineDisplay *display;
 
   g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), NULL);
-
+  g_return_val_if_fail (line != NULL, NULL);
+  
   if (line_data == NULL)
     {
       line_data = _gtk_text_line_data_new (layout, line);
@@ -1454,7 +1458,7 @@ add_cursor (GtkTextLayout      *layout,
       cursor->y = PANGO_PIXELS (strong_pos.y);
       cursor->height = PANGO_PIXELS (strong_pos.height);
       cursor->is_strong = TRUE;
-      cursor->is_weak = FALSE;
+      cursor->is_weak = (layout->cursor_direction == GTK_TEXT_DIR_NONE) ? FALSE : TRUE;
       display->cursors = g_slist_prepend (display->cursors, cursor);
     }
   
@@ -1469,7 +1473,7 @@ add_cursor (GtkTextLayout      *layout,
          cursor->x = PANGO_PIXELS (weak_pos.x);
          cursor->y = PANGO_PIXELS (weak_pos.y);
          cursor->height = PANGO_PIXELS (weak_pos.height);
-         cursor->is_strong = FALSE;
+         cursor->is_strong = (layout->cursor_direction == GTK_TEXT_DIR_NONE) ? FALSE : TRUE;
          cursor->is_weak = TRUE;
          display->cursors = g_slist_prepend (display->cursors, cursor);
        }
@@ -2426,6 +2430,7 @@ find_display_line_above (GtkTextLayout *layout,
           if (tmp_top < y)
             {
               found_line = line;
+             pango_layout_iter_free (layout_iter);
               goto done;
             }
         }