added new function gimp_display_shell_unset_cursor().

2008-03-30  Sven Neumann  <sven@gimp.org>

	* 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().


svn path=/trunk/; revision=25312
This commit is contained in:
Sven Neumann
2008-03-30 16:09:55 +00:00
committed by Sven Neumann
parent 4ea4a2dbc1
commit 9acc157a75
4 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,14 @@
2008-03-30 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* gimpheal.c (gimp_heal_motion): applied the same cleanups as in

View File

@ -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)
{

View File

@ -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);

View File

@ -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));