summary refs log tree commit diff stats
path: root/src/fe-gtk/xtext.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-gtk/xtext.c')
-rw-r--r--src/fe-gtk/xtext.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index e151524d..81805d99 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -1034,11 +1034,7 @@ gtk_xtext_realize (GtkWidget * widget)
 
 	gdk_window_set_user_data (widget->window, widget);
 
-#if GTK_CHECK_VERSION(2,24,0)
 	xtext->depth = gdk_window_get_visual (widget->window)->depth;
-#else
-	xtext->depth = gdk_drawable_get_visual (widget->window)->depth;
-#endif
 
 	val.subwindow_mode = GDK_INCLUDE_INFERIORS;
 	val.graphics_exposures = 0;
@@ -3204,6 +3200,7 @@ gtk_xtext_render_str (GtkXText * xtext, int y, textentry * ent,
 					if (col_num == 99)	/* mIRC lameness */
 						col_num = XTEXT_FG;
 					else
+					if (col_num > XTEXT_MAX_COLOR)
 						col_num = col_num % XTEXT_MIRC_COLS;
 					xtext->col_fore = col_num;
 					if (!mark)
@@ -3230,6 +3227,7 @@ gtk_xtext_render_str (GtkXText * xtext, int y, textentry * ent,
 						if (col_num == 99)	/* mIRC lameness */
 							col_num = XTEXT_BG;
 						else
+						if (col_num > XTEXT_MAX_COLOR)
 							col_num = col_num % XTEXT_MIRC_COLS;
 						if (col_num == XTEXT_BG)
 							xtext->backcolor = FALSE;
@@ -3243,6 +3241,7 @@ gtk_xtext_render_str (GtkXText * xtext, int y, textentry * ent,
 						if (col_num == 99)	/* mIRC lameness */
 							col_num = XTEXT_FG;
 						else
+						if (col_num > XTEXT_MAX_COLOR)
 							col_num = col_num % XTEXT_MIRC_COLS;
 						if (!mark)
 							xtext_set_fg (xtext, gc, col_num);