diff options
| author | Jan Djärv | 2003-03-08 15:57:47 +0000 |
|---|---|---|
| committer | Jan Djärv | 2003-03-08 15:57:47 +0000 |
| commit | 26b74a0bd022bc62c7babf7d12e2fd001a0f31f0 (patch) | |
| tree | 30c18a3db8686a8ec78899954afdfb332ef58055 /src | |
| parent | d8fa9fdc61161d85128671f856053639e2091631 (diff) | |
| download | emacs-26b74a0bd022bc62c7babf7d12e2fd001a0f31f0.tar.gz emacs-26b74a0bd022bc62c7babf7d12e2fd001a0f31f0.zip | |
* gtkutil.c (update_frame_tool_bar): Compare pixmap ID instead of
struct image* when desciding to update (struct image* may have been
deleted from the image cache).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/gtkutil.c | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bfeba6fabec..06ec1b20ad2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2003-03-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 1 | 2003-03-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * gtkutil.c (update_frame_tool_bar): Compare pixmap ID instead of | ||
| 4 | struct image* when desciding to update (struct image* may have been | ||
| 5 | deleted from the image cache). | ||
| 6 | |||
| 3 | * xterm.c (handle_one_xevent): Pass ReparentNotify to Xt even if | 7 | * xterm.c (handle_one_xevent): Pass ReparentNotify to Xt even if |
| 4 | the event isn't for a frame (i.e. for dialogs). | 8 | the event isn't for a frame (i.e. for dialogs). |
| 5 | 9 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 609243912bd..bae21969656 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -2769,7 +2769,7 @@ update_frame_tool_bar (f) | |||
| 2769 | struct image *img; | 2769 | struct image *img; |
| 2770 | Lisp_Object image; | 2770 | Lisp_Object image; |
| 2771 | GtkWidget *wicon = iter ? GTK_WIDGET (iter->data) : 0; | 2771 | GtkWidget *wicon = iter ? GTK_WIDGET (iter->data) : 0; |
| 2772 | 2772 | ||
| 2773 | if (iter) iter = g_list_next (iter); | 2773 | if (iter) iter = g_list_next (iter); |
| 2774 | 2774 | ||
| 2775 | /* If image is a vector, choose the image according to the | 2775 | /* If image is a vector, choose the image according to the |
| @@ -2825,7 +2825,7 @@ update_frame_tool_bar (f) | |||
| 2825 | /* Save the image so we can see if an update is needed when | 2825 | /* Save the image so we can see if an update is needed when |
| 2826 | this function is called again. */ | 2826 | this function is called again. */ |
| 2827 | g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA, | 2827 | g_object_set_data (G_OBJECT (w), XG_TOOL_BAR_IMAGE_DATA, |
| 2828 | (gpointer)img); | 2828 | (gpointer)img->pixmap); |
| 2829 | 2829 | ||
| 2830 | /* Catch expose events to overcome an annoying redraw bug, see | 2830 | /* Catch expose events to overcome an annoying redraw bug, see |
| 2831 | comment for xg_tool_bar_expose_callback. */ | 2831 | comment for xg_tool_bar_expose_callback. */ |
| @@ -2867,13 +2867,11 @@ update_frame_tool_bar (f) | |||
| 2867 | GtkWidget *wvbox = gtk_bin_get_child (GTK_BIN (wicon)); | 2867 | GtkWidget *wvbox = gtk_bin_get_child (GTK_BIN (wicon)); |
| 2868 | GList *chlist = gtk_container_get_children (GTK_CONTAINER (wvbox)); | 2868 | GList *chlist = gtk_container_get_children (GTK_CONTAINER (wvbox)); |
| 2869 | GtkImage *wimage = GTK_IMAGE (chlist->data); | 2869 | GtkImage *wimage = GTK_IMAGE (chlist->data); |
| 2870 | struct image *old_img = g_object_get_data (G_OBJECT (wimage), | 2870 | Pixmap old_img = (Pixmap)g_object_get_data (G_OBJECT (wimage), |
| 2871 | XG_TOOL_BAR_IMAGE_DATA); | 2871 | XG_TOOL_BAR_IMAGE_DATA); |
| 2872 | g_list_free (chlist); | 2872 | g_list_free (chlist); |
| 2873 | 2873 | ||
| 2874 | if (! old_img | 2874 | if (old_img != img->pixmap) |
| 2875 | || old_img->pixmap != img->pixmap | ||
| 2876 | || old_img->mask != img->mask) | ||
| 2877 | { | 2875 | { |
| 2878 | GdkPixmap *gpix = gdk_pixmap_foreign_new (img->pixmap); | 2876 | GdkPixmap *gpix = gdk_pixmap_foreign_new (img->pixmap); |
| 2879 | GdkBitmap *gmask = img->mask ? | 2877 | GdkBitmap *gmask = img->mask ? |
| @@ -2883,7 +2881,7 @@ update_frame_tool_bar (f) | |||
| 2883 | } | 2881 | } |
| 2884 | 2882 | ||
| 2885 | g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, | 2883 | g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, |
| 2886 | (gpointer)img); | 2884 | (gpointer)img->pixmap); |
| 2887 | 2885 | ||
| 2888 | gtk_widget_set_sensitive (wicon, enabled_p); | 2886 | gtk_widget_set_sensitive (wicon, enabled_p); |
| 2889 | gtk_widget_show (wicon); | 2887 | gtk_widget_show (wicon); |