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);
{
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
{
{
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
{
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)
{
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 */