diff options
| author | Richard M. Stallman | 2003-03-27 03:06:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-03-27 03:06:16 +0000 |
| commit | 84f2e615526fec2051c9980aff9c52d406847ca5 (patch) | |
| tree | cc50b160c3371287ceabb641fc79128d976e0a02 /src | |
| parent | 5fd6f7273981c1c3c5c8bd8b21661e2f89e05ab8 (diff) | |
| download | emacs-84f2e615526fec2051c9980aff9c52d406847ca5.tar.gz emacs-84f2e615526fec2051c9980aff9c52d406847ca5.zip | |
(update_tool_bar): Recompute tool bar if
update_mode_lines is set. Set w->update_mode_line
only if the tool bar contents actually change.
(update_menu_bar): Undo previous change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 18 |
2 files changed, 17 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b4b834eaa3c..54cfc69a208 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2003-03-26 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (update_tool_bar): Recompute tool bar if | ||
| 4 | update_mode_lines is set. Set w->update_mode_line | ||
| 5 | only if the tool bar contents actually change. | ||
| 6 | (update_menu_bar): Undo previous change. | ||
| 7 | |||
| 1 | 2003-03-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 8 | 2003-03-26 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 9 | ||
| 3 | * gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared. | 10 | * gtkutil.c (xg_resize_widgets): Don't call xg_frame_cleared. |
diff --git a/src/xdisp.c b/src/xdisp.c index 32c84757072..a50260dab9b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -7905,16 +7905,11 @@ update_menu_bar (f, save_match_data) | |||
| 7905 | window = FRAME_SELECTED_WINDOW (f); | 7905 | window = FRAME_SELECTED_WINDOW (f); |
| 7906 | w = XWINDOW (window); | 7906 | w = XWINDOW (window); |
| 7907 | 7907 | ||
| 7908 | #if 1 /* The if statement below this if statement used to include the | 7908 | #if 0 /* The if statement below this if statement used to include the |
| 7909 | condition !NILP (w->update_mode_line), rather than using | 7909 | condition !NILP (w->update_mode_line), rather than using |
| 7910 | update_mode_lines directly, and this if statement may have | 7910 | update_mode_lines directly, and this if statement may have |
| 7911 | been added to make that condition work. Now the if | 7911 | been added to make that condition work. Now the if |
| 7912 | statement below matches its comment, this isn't needed. */ | 7912 | statement below matches its comment, this isn't needed. */ |
| 7913 | /* We need to set w->update_mode_line to Qt so that update_tool_bar | ||
| 7914 | rebuilds tool bar items. For example, to notice when a tool bar item | ||
| 7915 | goes from enabled to disabled state. | ||
| 7916 | A better way would be to notice tool bar, menu bar and mode line | ||
| 7917 | changes separately, but for now update_mode_line is all we got. */ | ||
| 7918 | if (update_mode_lines) | 7913 | if (update_mode_lines) |
| 7919 | w->update_mode_line = Qt; | 7914 | w->update_mode_line = Qt; |
| 7920 | #endif | 7915 | #endif |
| @@ -8124,6 +8119,7 @@ update_tool_bar (f, save_match_data) | |||
| 8124 | windows_or_buffers_changed anyway. */ | 8119 | windows_or_buffers_changed anyway. */ |
| 8125 | if (windows_or_buffers_changed | 8120 | if (windows_or_buffers_changed |
| 8126 | || !NILP (w->update_mode_line) | 8121 | || !NILP (w->update_mode_line) |
| 8122 | || update_mode_lines | ||
| 8127 | || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) | 8123 | || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) |
| 8128 | < BUF_MODIFF (XBUFFER (w->buffer))) | 8124 | < BUF_MODIFF (XBUFFER (w->buffer))) |
| 8129 | != !NILP (w->last_had_star)) | 8125 | != !NILP (w->last_had_star)) |
| @@ -8133,6 +8129,8 @@ update_tool_bar (f, save_match_data) | |||
| 8133 | { | 8129 | { |
| 8134 | struct buffer *prev = current_buffer; | 8130 | struct buffer *prev = current_buffer; |
| 8135 | int count = SPECPDL_INDEX (); | 8131 | int count = SPECPDL_INDEX (); |
| 8132 | Lisp_Object old_tool_bar; | ||
| 8133 | struct gcpro gcpro1; | ||
| 8136 | 8134 | ||
| 8137 | /* Set current_buffer to the buffer of the selected | 8135 | /* Set current_buffer to the buffer of the selected |
| 8138 | window of the frame, so that we get the right local | 8136 | window of the frame, so that we get the right local |
| @@ -8150,12 +8148,16 @@ update_tool_bar (f, save_match_data) | |||
| 8150 | specbind (Qoverriding_local_map, Qnil); | 8148 | specbind (Qoverriding_local_map, Qnil); |
| 8151 | } | 8149 | } |
| 8152 | 8150 | ||
| 8151 | old_tool_bar = f->tool_bar_items; | ||
| 8152 | GCPRO1 (old_tool_bar); | ||
| 8153 | |||
| 8153 | /* Build desired tool-bar items from keymaps. */ | 8154 | /* Build desired tool-bar items from keymaps. */ |
| 8154 | f->tool_bar_items | 8155 | f->tool_bar_items |
| 8155 | = tool_bar_items (f->tool_bar_items, &f->n_tool_bar_items); | 8156 | = tool_bar_items (f->tool_bar_items, &f->n_tool_bar_items); |
| 8156 | 8157 | ||
| 8157 | /* Redisplay the tool-bar in case we changed it. */ | 8158 | /* Redisplay the tool-bar if we changed it. */ |
| 8158 | w->update_mode_line = Qt; | 8159 | if (! NILP (Fequal (old_tool_bar, f->tool_bar_items))) |
| 8160 | w->update_mode_line = Qt; | ||
| 8159 | 8161 | ||
| 8160 | unbind_to (count, Qnil); | 8162 | unbind_to (count, Qnil); |
| 8161 | set_buffer_internal_1 (prev); | 8163 | set_buffer_internal_1 (prev); |