CVS: sylpheed-claws/src textview.c,1.96.2.111,1.96.2.112

Colin Leroy <[email protected]>
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /cvsroot/sylpheed-claws/sylpheed-claws/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10867/src

Modified Files:
      Tag: gtk2
	textview.c 
Log Message:
2006-04-18 [colin]	2.1.1cvs14

	* src/textview.c
		Fix gdk warnings on set_cursor when textview
		isn't visible

Index: textview.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/textview.c,v
retrieving revision 1.96.2.111
retrieving revision 1.96.2.112
diff -u -r1.96.2.111 -r1.96.2.112
--- textview.c	16 Apr 2006 20:56:16 -0000	1.96.2.111
+++ textview.c	18 Apr 2006 16:41:51 -0000	1.96.2.112
@@ -1188,6 +1188,11 @@
 	textview->uri_list = g_slist_append(textview->uri_list, r_uri);
 }
 
+static void textview_set_cursor(GdkWindow *window, GdkCursor *cursor)
+{
+	if (GDK_IS_WINDOW(window))
+		gdk_window_set_cursor(window, cursor);
+}
 void textview_clear(TextView *textview)
 {
 	GtkTextView *text = GTK_TEXT_VIEW(textview->text);
@@ -1209,9 +1214,9 @@
 	textview->image = NULL;
 
 	if (textview->messageview->mainwin->cursor_count == 0) {
-		gdk_window_set_cursor(window, text_cursor);
+		textview_set_cursor(window, text_cursor);
 	} else {
-		gdk_window_set_cursor(window, watch_cursor);
+		textview_set_cursor(window, watch_cursor);
 	}
 }
 
@@ -1852,7 +1857,7 @@
 	GdkWindow *window = gtk_text_view_get_window(
 			GTK_TEXT_VIEW(textview->text),
 			GTK_TEXT_WINDOW_TEXT);
-	gdk_window_set_cursor(window, watch_cursor);
+	textview_set_cursor(window, watch_cursor);
 }
 
 void textview_cursor_normal(TextView *textview)
@@ -1860,7 +1865,7 @@
 	GdkWindow *window = gtk_text_view_get_window(
 			GTK_TEXT_VIEW(textview->text),
 			GTK_TEXT_WINDOW_TEXT);
-	gdk_window_set_cursor(window, text_cursor);
+	textview_set_cursor(window, text_cursor);
 }
 
 static void textview_uri_update(TextView *textview, gint x, gint y)
@@ -1922,9 +1927,9 @@
 		window = gtk_text_view_get_window(GTK_TEXT_VIEW(textview->text),
 						  GTK_TEXT_WINDOW_TEXT);
 		if (textview->messageview->mainwin->cursor_count == 0) {
-			gdk_window_set_cursor(window, uri ? hand_cursor : text_cursor);
+			textview_set_cursor(window, uri ? hand_cursor : text_cursor);
 		} else {
-			gdk_window_set_cursor(window, watch_cursor);
+			textview_set_cursor(window, watch_cursor);
 		}
 
 		TEXTVIEW_STATUSBAR_POP(textview);



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.