From 88ee13db561369469b8916f19a911430b77ee295 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Thu, 24 Sep 2009 10:05:43 +0200 Subject: [PATCH] Go via the toplevel to get to the statusbar for setting coords Only a visible shell can produce cursor coordinates, so no need to check for the image window's active display. --- app/display/gimpdisplayshell-cursor.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/display/gimpdisplayshell-cursor.c b/app/display/gimpdisplayshell-cursor.c index 55fa10c2f6..9738e6e4a6 100644 --- a/app/display/gimpdisplayshell-cursor.c +++ b/app/display/gimpdisplayshell-cursor.c @@ -124,6 +124,8 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell, gdouble image_x, gdouble image_y) { + GtkWidget *toplevel; + GtkWidget *statusbar; GimpDialogFactory *factory; GimpSessionInfo *session_info; GimpImage *image; @@ -159,8 +161,10 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell, /* use the passed image_coords for the statusbar because they are * possibly snapped... */ - /* FIXME image window */ - gimp_statusbar_update_cursor (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar), + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell)); + statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar; + + gimp_statusbar_update_cursor (GIMP_STATUSBAR (statusbar), precision, image_x, image_y); factory = gimp_dialog_factory_from_name ("dock"); @@ -192,13 +196,17 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell, void gimp_display_shell_clear_cursor (GimpDisplayShell *shell) { + GtkWidget *toplevel; + GtkWidget *statusbar; GimpDialogFactory *factory; GimpSessionInfo *session_info; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - /* FIXME image window */ - gimp_statusbar_clear_cursor (GIMP_STATUSBAR (GIMP_IMAGE_WINDOW (shell)->statusbar)); + toplevel = gtk_widget_get_toplevel (GTK_WIDGET (shell)); + statusbar = GIMP_IMAGE_WINDOW (toplevel)->statusbar; + + gimp_statusbar_clear_cursor (GIMP_STATUSBAR (statusbar)); factory = gimp_dialog_factory_from_name ("dock"); session_info = gimp_dialog_factory_find_session_info (factory,