# HG changeset patch # User Jan Dj¸«£rv # Date 1099235491 0 # Node ID 6cc2262110d2fe6250a4aff9fcc983db4743f27d # Parent 938845bec84553faacf91ce63f1e7cbfc95b1de1 * 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. diff -r 938845bec845 -r 6cc2262110d2 src/ChangeLog --- a/src/ChangeLog Sun Oct 31 12:25:46 2004 +0000 +++ b/src/ChangeLog Sun Oct 31 15:11:31 2004 +0000 @@ -1,5 +1,10 @@ 2004-10-31 Jan Dj,Ad(Brv + * 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 -r 938845bec845 -r 6cc2262110d2 src/xdisp.c --- a/src/xdisp.c Sun Oct 31 12:25:46 2004 +0000 +++ b/src/xdisp.c Sun Oct 31 15:11:31 2004 +0000 @@ -8416,7 +8416,8 @@ { 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 @@ 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;