diff --git a/ChangeLog b/ChangeLog index be7cfbb8ad..2d66ba5f5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-03-30 Sven Neumann + + * app/display/gimpdisplayshell-cursor.[ch]: added new function + gimp_display_shell_unset_cursor(). + (gimp_display_shell_real_set_cursor): deal with cursor_type -1 and + change the cursor to the default desktop cursor. Fixes warnings on + image load. + + * app/display/gimpdisplayshell.c (gimp_display_shell_empty): + use gimp_display_shell_unset_cursor(). + 2008-03-30 Sven Neumann * gimpheal.c (gimp_heal_motion): applied the same cleanups as in diff --git a/app/display/gimpdisplayshell-cursor.c b/app/display/gimpdisplayshell-cursor.c index e20b8a1e86..ddfb665fc5 100644 --- a/app/display/gimpdisplayshell-cursor.c +++ b/app/display/gimpdisplayshell-cursor.c @@ -66,6 +66,18 @@ gimp_display_shell_set_cursor (GimpDisplayShell *shell, } } +void +gimp_display_shell_unset_cursor (GimpDisplayShell *shell) +{ + g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); + + if (! shell->using_override_cursor) + { + gimp_display_shell_real_set_cursor (shell, + (GimpCursorType) -1, 0, 0, FALSE); + } +} + void gimp_display_shell_set_override_cursor (GimpDisplayShell *shell, GimpCursorType cursor_type) @@ -213,6 +225,16 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell, g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); + if (cursor_type == (GimpCursorType) -1) + { + shell->current_cursor = cursor_type; + + if (GTK_WIDGET_DRAWABLE (shell->canvas)) + gdk_window_set_cursor (shell->canvas->window, NULL); + + return; + } + if (cursor_type != GIMP_CURSOR_NONE && cursor_type != GIMP_CURSOR_BAD) { diff --git a/app/display/gimpdisplayshell-cursor.h b/app/display/gimpdisplayshell-cursor.h index ea6bc0959c..f193a2f903 100644 --- a/app/display/gimpdisplayshell-cursor.h +++ b/app/display/gimpdisplayshell-cursor.h @@ -24,6 +24,7 @@ void gimp_display_shell_set_cursor (GimpDisplayShell *shell, GimpCursorType cursor_type, GimpToolCursorType tool_cursor, GimpCursorModifier modifier); +void gimp_display_shell_unset_cursor (GimpDisplayShell *shell); void gimp_display_shell_set_override_cursor (GimpDisplayShell *shell, GimpCursorType cursor_type); void gimp_display_shell_unset_override_cursor (GimpDisplayShell *shell); diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 1adc3eea33..9492862d27 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -1286,7 +1286,7 @@ gimp_display_shell_empty (GimpDisplayShell *shell) gimp_display_shell_scale_setup (shell); gimp_display_shell_scaled (shell); - gdk_window_set_cursor (shell->canvas->window, NULL); + gimp_display_shell_unset_cursor (shell); gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));