]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktextdisplay.c
Fix ZWJ => ZWN typo. (#83092, Tino Meinen)
[~andy/gtk] / gtk / gtktextdisplay.c
index cfb5225d747daf9ce107a50f96bc3d1b937c9c31..75b3fc932cbb8b76daa50a75c13c371313a058d9 100644 (file)
@@ -143,6 +143,8 @@ static void
 gtk_text_render_state_update (GtkTextRenderState *state,
                               GtkTextAppearance  *new_appearance)
 {
+  GdkScreen *screen = gtk_widget_get_screen (state->widget);
+  
   if (!state->last_appearance ||
       !gdk_color_equal (&new_appearance->fg_color, &state->last_appearance->fg_color))
     gtk_text_render_state_set_color (state, state->fg_gc, &new_appearance->fg_color);
@@ -152,8 +154,15 @@ gtk_text_render_state_update (GtkTextRenderState *state,
     {
       if (new_appearance->fg_stipple)
         {
-          gdk_gc_set_fill (state->fg_gc, GDK_STIPPLED);
-          gdk_gc_set_stipple (state->fg_gc, new_appearance->fg_stipple);
+         if (screen == gdk_drawable_get_screen (new_appearance->fg_stipple))
+           {
+             gdk_gc_set_fill (state->fg_gc, GDK_STIPPLED);
+             gdk_gc_set_stipple (state->fg_gc, new_appearance->fg_stipple);
+           }
+         else
+           g_warning ("gtk_text_render_state_update:\n"
+                      "The foreground stipple bitmap has been created on the wrong screen.\n"
+                      "Ignoring the stipple bitmap information.");
         }
       else
         {
@@ -172,8 +181,16 @@ gtk_text_render_state_update (GtkTextRenderState *state,
         {
           if (new_appearance->bg_stipple)
             {
-              gdk_gc_set_fill (state->bg_gc, GDK_STIPPLED);
-              gdk_gc_set_stipple (state->bg_gc, new_appearance->bg_stipple);
+             if (screen == gdk_drawable_get_screen (new_appearance->bg_stipple))
+               {
+                 gdk_gc_set_fill (state->bg_gc, GDK_STIPPLED);
+                 gdk_gc_set_stipple (state->bg_gc, new_appearance->bg_stipple);
+               }
+             else
+               g_warning ("gtk_text_render_state_update:\n"
+                          "The background stipple bitmap has been created on the wrong screen.\n"
+                          "Ignoring the stipple bitmap information.");
+
             }
           else
             {
@@ -834,14 +851,8 @@ gtk_text_layout_draw (GtkTextLayout *layout,
               GtkTextCursorDisplay *cursor = cursor_list->data;
              GtkTextDirection dir;
              GdkRectangle cursor_location;
-
               GdkGC *gc;
 
-              if (cursor->is_strong)
-                gc = cursor_gc;
-              else
-                gc = widget->style->text_gc[GTK_STATE_NORMAL];
-
               dir = line_display->direction;
              if (have_strong && have_weak)
                {
@@ -854,11 +865,14 @@ gtk_text_layout_draw (GtkTextLayout *layout,
              cursor_location.width = 0;
              cursor_location.height = cursor->height;
  
+             gc = _gtk_get_insertion_cursor_gc (widget, cursor->is_strong);
              gdk_gc_set_clip_rectangle(gc, &clip);
              _gtk_draw_insertion_cursor (widget, drawable, gc, &cursor_location,
                                           dir, have_strong && have_weak);
               gdk_gc_set_clip_rectangle (gc, NULL);
 
+             g_object_unref (gc);
+
               cursor_list = cursor_list->next;
             }
         } /* line_display->height > 0 */