aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Djärv <[email protected]>2004-10-31 15:11:31 +0000
committerJan Djärv <[email protected]>2004-10-31 15:11:31 +0000
commit12e6566a256a5c18a018645e6cbd461eb8662e62 (patch)
tree4bdaef28c6d1960bcbfee5a16ff220aee5caa199
parentfcdb28b473b74bd2a2d79675280764d3abde0659 (diff)
* xdisp.c (update_tool_bar): Pass a copy of f->tool_bar_items to
tool_bar_items and assign the result to f->tool_bar_items if not equal. Move BLOCK/UNBLOCK_INPUT from around call to tool_bar_items to assignment of result.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xdisp.c25
2 files changed, 21 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 8de855df2e..76a6676a0c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2004-10-31 Jan Dj,Ad(Brv <[email protected]>
+ * xdisp.c (update_tool_bar): Pass a copy of f->tool_bar_items to
+ tool_bar_items and assign the result to f->tool_bar_items if
+ not equal. Move BLOCK/UNBLOCK_INPUT from around call to
+ tool_bar_items to assignment of result.
+
* atimer.c (alarm_signal_handler): Do not call set_alarm if
pending_atmers is non-zero.
diff --git a/src/xdisp.c b/src/xdisp.c
index df68ab80ef..dfb2e8198a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8416,7 +8416,8 @@ update_tool_bar (f, save_match_data)
{
struct buffer *prev = current_buffer;
int count = SPECPDL_INDEX ();
- Lisp_Object old_tool_bar;
+ Lisp_Object new_tool_bar;
+ int new_n_tool_bar;
struct gcpro gcpro1;
/* Set current_buffer to the buffer of the selected
@@ -8435,18 +8436,24 @@ update_tool_bar (f, save_match_data)
specbind (Qoverriding_local_map, Qnil);
}
- old_tool_bar = f->tool_bar_items;
- GCPRO1 (old_tool_bar);
+ GCPRO1 (new_tool_bar);
/* Build desired tool-bar items from keymaps. */
- BLOCK_INPUT;
- f->tool_bar_items
- = tool_bar_items (f->tool_bar_items, &f->n_tool_bar_items);
- UNBLOCK_INPUT;
+ new_tool_bar = tool_bar_items (Fcopy_sequence (f->tool_bar_items),
+ &new_n_tool_bar);
/* Redisplay the tool-bar if we changed it. */
- if (! NILP (Fequal (old_tool_bar, f->tool_bar_items)))
- w->update_mode_line = Qt;
+ if (NILP (Fequal (new_tool_bar, f->tool_bar_items)))
+ {
+ /* Redisplay that happens asynchronously due to an expose event
+ may access f->tool_bar_items. Make sure we update both
+ variables within BLOCK_INPUT so no such event interrupts. */
+ BLOCK_INPUT;
+ f->tool_bar_items = new_tool_bar;
+ f->n_tool_bar_items = new_n_tool_bar;
+ w->update_mode_line = Qt;
+ UNBLOCK_INPUT;
+ }
UNGCPRO;