Mercurial > pidgin.yaz
comparison src/gtkutils.c @ 13469:689f652480f7
[gaim-migrate @ 15845]
For cursor setting, it's the widget's window being NULL that's the problem. Passing in a NULL widget wouldn't make any sense. So, I've clarified the checks here. This fixes a couple assertion failure regressions.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Wed, 08 Mar 2006 22:03:22 +0000 |
parents | ffd724befbf8 |
children | 743e38a3182b |
comparison
equal
deleted
inserted
replaced
13468:e4aa2648ca28 | 13469:689f652480f7 |
---|---|
2182 | 2182 |
2183 void gaim_gtk_set_cursor(GtkWidget *widget, GdkCursorType cursor_type) | 2183 void gaim_gtk_set_cursor(GtkWidget *widget, GdkCursorType cursor_type) |
2184 { | 2184 { |
2185 GdkCursor *cursor; | 2185 GdkCursor *cursor; |
2186 | 2186 |
2187 if (widget == NULL) | 2187 g_return_if_fail(widget != NULL); |
2188 if (widget->window == NULL) | |
2188 return; | 2189 return; |
2189 | 2190 |
2190 cursor = gdk_cursor_new(GDK_WATCH); | 2191 cursor = gdk_cursor_new(GDK_WATCH); |
2191 gdk_window_set_cursor(widget->window, cursor); | 2192 gdk_window_set_cursor(widget->window, cursor); |
2192 gdk_cursor_unref(cursor); | 2193 gdk_cursor_unref(cursor); |
2198 #endif | 2199 #endif |
2199 } | 2200 } |
2200 | 2201 |
2201 void gaim_gtk_clear_cursor(GtkWidget *widget) | 2202 void gaim_gtk_clear_cursor(GtkWidget *widget) |
2202 { | 2203 { |
2203 if (widget == NULL) | 2204 g_return_if_fail(widget != NULL); |
2205 if (widget->window == NULL) | |
2204 return; | 2206 return; |
2205 | 2207 |
2206 gdk_window_set_cursor(widget->window, NULL); | 2208 gdk_window_set_cursor(widget->window, NULL); |
2207 } | 2209 } |
2208 | 2210 |