From 3c0ca31948ced5386a9578cbef659cd5218ebf96 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 25 Aug 2005 19:22:20 +0000 Subject: [PATCH] Handle theme == NULL. 2005-08-25 Owen Taylor * gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): Handle theme == NULL. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ gdk/x11/gdkcursor-x11.c | 8 +++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82f7a05ab4..5b72db39de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-08-25 Owen Taylor + + * gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): + Handle theme == NULL. + 2005-08-25 Matthias Clasen * gtk/gtkmenutoolbutton.c (menu_position_func): Take widget diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 82f7a05ab4..5b72db39de 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-08-25 Owen Taylor + + * gdk/x11/gdkcursor-x11.c (gdk_x11_display_set_cursor_theme): + Handle theme == NULL. + 2005-08-25 Matthias Clasen * gtk/gtkmenutoolbutton.c (menu_position_func): Take widget diff --git a/gdk/x11/gdkcursor-x11.c b/gdk/x11/gdkcursor-x11.c index c816b5d656..fb4f53b149 100644 --- a/gdk/x11/gdkcursor-x11.c +++ b/gdk/x11/gdkcursor-x11.c @@ -446,7 +446,8 @@ update_cursor (gpointer key, /** * gdk_x11_display_set_cursor_theme: * @display: a #GdkDisplay - * @theme: the name of the cursor theme to use + * @theme: the name of the cursor theme to use, or %NULL to unset + * a previously set value * @size: the cursor size to use * * Sets the cursor theme from which the images for cursor @@ -481,8 +482,9 @@ gdk_x11_display_set_cursor_theme (GdkDisplay *display, old_theme = XcursorGetTheme (xdisplay); old_size = XcursorGetDefaultSize (xdisplay); - if (old_size == size && - old_theme && strcmp (old_theme, theme) == 0) + if (old_size == size && + (old_theme == theme || + (old_theme && theme && strcmp (old_theme, theme) == 0))) return; theme_serial++;