--- toolbar-carbon.c.old 2005-05-25 21:27:28.000000000 -0600 +++ toolbar-carbon.c 2005-05-25 21:50:47.000000000 -0600 @@ -339,7 +339,7 @@ static void carbon_output_frame_toolbars (struct frame *f) { - ShowHideWindowToolbar (FRAME_CARBON_WINDOW (f), FRAME_REAL_TOP_TOOLBAR_VISIBLE (f), false); + ShowHideWindowToolbar (FRAME_CARBON_WINDOW (f), FRAME_REAL_TOP_TOOLBAR_VISIBLE (f), false); if (!FRAME_REAL_TOP_TOOLBAR_VISIBLE (f)) return; @@ -354,9 +354,6 @@ CFIndex item_count = CFArrayGetCount (items); CFRelease (items); - for (CFIndex i = 0 ; i < item_count; i++) - HIToolbarRemoveItemAtIndex (toolbar, 0); - Lisp_Object button = FRAME_TOOLBAR_BUTTONS (f, TOP_TOOLBAR); int i = 0; @@ -378,6 +375,10 @@ button = XTOOLBAR_BUTTON (button)->next; } + + /* Delete items that were already present in the toolbar before those appended in the preceding loop. If these are deleted before items are added, the toolbar becomes empty temporarily and OS X 10.4 hides it and shows it again when the first item is added, resulting in an unwanted visual effect on screen. */ + for (CFIndex i = 0 ; i < item_count; i++) + HIToolbarRemoveItemAtIndex (toolbar, 0); } static void