From 2b711ebbdac69821458c3f4ebdfd2f10115e0783 Mon Sep 17 00:00:00 2001 From: BST 1999 Andy Thomas Date: Thu, 24 Jun 1999 21:54:48 +0000 Subject: [PATCH] layers_dialog.c lc_dialog.c lc_dialogP.h Thu Jun 24 22:49:41 BST 1999 Andy Thomas * layers_dialog.c * lc_dialog.c * lc_dialogP.h L&C&P previews are now updated on undo and layer movement operations. --- ChangeLog | 9 +++++++++ app/gui/layers-dialog.c | 1 + app/layers_dialog.c | 1 + app/lc_dialog.c | 17 +++++++++++------ app/lc_dialogP.h | 2 ++ 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2d5f3ab22..5a43b77efe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Thu Jun 24 22:49:41 BST 1999 Andy Thomas + + * layers_dialog.c + * lc_dialog.c + * lc_dialogP.h + + L&C&P previews are now updated on undo and layer movement + operations. + Thu Jun 24 22:34:54 MEST 1999 Sven Neumann * plug-ins/gap: some changes on request by the author Wolfgang Hofer diff --git a/app/gui/layers-dialog.c b/app/gui/layers-dialog.c index 44034ab0dc..6ea753b635 100644 --- a/app/gui/layers-dialog.c +++ b/app/gui/layers-dialog.c @@ -2383,6 +2383,7 @@ layer_widget_preview_redraw (LayerWidget *layer_widget, */ gdk_flush (); } + lc_dialog_menu_preview_dirty(GTK_OBJECT(gimp_drawable_gimage(GIMP_DRAWABLE(layer_widget->layer))),NULL); } static void diff --git a/app/layers_dialog.c b/app/layers_dialog.c index 44034ab0dc..6ea753b635 100644 --- a/app/layers_dialog.c +++ b/app/layers_dialog.c @@ -2383,6 +2383,7 @@ layer_widget_preview_redraw (LayerWidget *layer_widget, */ gdk_flush (); } + lc_dialog_menu_preview_dirty(GTK_OBJECT(gimp_drawable_gimage(GIMP_DRAWABLE(layer_widget->layer))),NULL); } static void diff --git a/app/lc_dialog.c b/app/lc_dialog.c index 12b172fe17..67a5071a5a 100644 --- a/app/lc_dialog.c +++ b/app/lc_dialog.c @@ -288,9 +288,9 @@ image_menu_preview_update_do(GimpImage *gimage) return FALSE; } -static void -menu_preview_dirty (GtkObject *obj, - gpointer client_data) +void +lc_dialog_menu_preview_dirty (GtkObject *obj, + gpointer client_data) { /* Update preview at a less busy time */ /* printf("menu_preview_dirty:: adding %p to obj %p\n",client_data,obj); */ @@ -310,11 +310,16 @@ lc_dialog_image_menu_preview_update_cb (GtkWidget *widget, { GtkWidget *menu_preview; GimpImage *gimage; - GimpImage *gimage_to_update = GIMP_IMAGE((GimpImage *)client_data); + GimpImage *gimage_to_update = (GimpImage *)client_data; + + /* This is called via an idle function, so it is possible + * that the client_data no longer points to a GimpImage.. So don't + * pass it to the GIMP_IMAGE() cast function. We never deference + * it here anyways. + */ menu_preview = (GtkWidget *)gtk_object_get_data(GTK_OBJECT(widget),"menu_preview"); gimage = GIMP_IMAGE((GimpImage *)gtk_object_get_data(GTK_OBJECT(widget),"menu_preview_gimage")); -/* printf("image_menu_preview_update::menu_preview = %p gimage %p gimage_to_update %d\n",menu_preview,gimage,gimage_to_update); */ if(menu_preview && gimage && gimage_to_update == gimage) { @@ -591,7 +596,7 @@ lc_dialog_create_image_menu_cb (gpointer im, /* Only add this signal once */ gtk_object_set_data(GTK_OBJECT (gimage),"menu_preview_dirty",(gpointer)1); gtk_signal_connect_after (GTK_OBJECT (gimage), "dirty", - GTK_SIGNAL_FUNC(menu_preview_dirty),NULL); + GTK_SIGNAL_FUNC(lc_dialog_menu_preview_dirty),NULL); } gtk_object_set_data(GTK_OBJECT(menu_item),"menu_preview",wcolor_box); gtk_object_set_data(GTK_OBJECT(menu_item),"menu_preview_gimage",gimage); diff --git a/app/lc_dialogP.h b/app/lc_dialogP.h index 80150f7318..276038b98c 100644 --- a/app/lc_dialogP.h +++ b/app/lc_dialogP.h @@ -51,6 +51,8 @@ void paths_dialog_flush (void); void layers_dialog_clear (void); void channels_dialog_clear (void); +void lc_dialog_menu_preview_dirty (GtkObject *,gpointer); + /* Main dialog structure */ extern LCDialog *lc_dialog;