comparison src/toolbar.c @ 905:c15f25529e61

[xemacs-hg @ 2002-07-06 21:05:42 by andyp] toolbar redisplay patch
author andyp
date Sat, 06 Jul 2002 21:05:58 +0000
parents 79c6ff3eef26
children c925bacdda60
comparison
equal deleted inserted replaced
904:47c30044fc4e 905:c15f25529e61
712 set_frame_toolbar (f, BOTTOM_TOOLBAR); 712 set_frame_toolbar (f, BOTTOM_TOOLBAR);
713 set_frame_toolbar (f, LEFT_TOOLBAR); 713 set_frame_toolbar (f, LEFT_TOOLBAR);
714 set_frame_toolbar (f, RIGHT_TOOLBAR); 714 set_frame_toolbar (f, RIGHT_TOOLBAR);
715 } 715 }
716 716
717 /* Update the toolbar geometry separately from actually displaying the
718 toolbar. This is necessary because both the gutter and the toolbar
719 are competing for redisplay cycles and, unfortunately, gutter
720 updates happen late in the game. Firstly they are done inside of
721 redisplay proper and secondly subcontrols may not get moved until
722 the next screen refresh. Only after subcontrols have been moved to
723 their final destinations can we be certain of updating the
724 toolbar. Under X this probably is exacerbated by the toolbar button
725 dirty flags which prevent updates happening when they possibly
726 should. */
717 void 727 void
718 update_frame_toolbars (struct frame *f) 728 update_frame_toolbars_geometry (struct frame *f)
719 { 729 {
720 struct device *d = XDEVICE (f->device); 730 struct device *d = XDEVICE (f->device);
721 731
722 if (DEVICE_SUPPORTS_TOOLBARS_P (d) 732 if (DEVICE_SUPPORTS_TOOLBARS_P (d)
723 && (f->toolbar_changed || f->frame_changed || f->clear)) 733 && (f->toolbar_changed
734 || f->frame_layout_changed
735 || f->frame_changed
736 || f->clear))
724 { 737 {
725 int pos; 738 int pos;
726 739
727 /* We're not officially "in redisplay", so we still have a 740 /* We're not officially "in redisplay", so we still have a
728 chance to re-layout toolbars and windows. This is done here, 741 chance to re-layout toolbars and windows. This is done here,
738 { 751 {
739 int width, height; 752 int width, height;
740 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), 753 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f),
741 &width, &height); 754 &width, &height);
742 change_frame_size (f, height, width, 0); 755 change_frame_size (f, height, width, 0);
756 MARK_FRAME_LAYOUT_CHANGED (f);
743 break; 757 break;
744 } 758 }
745 759
746 for (pos = 0; pos < 4; pos++) 760 for (pos = 0; pos < 4; pos++) {
747 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); 761 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos);
762 }
748 763
749 /* Removed the check for the minibuffer here. We handle this 764 /* Removed the check for the minibuffer here. We handle this
750 more correctly now by consistently using 765 more correctly now by consistently using
751 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW 766 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW
752 throughout the toolbar code. */ 767 throughout the toolbar code. */
753 compute_frame_toolbars_data (f); 768 compute_frame_toolbars_data (f);
754 769
770 /* Clear the previous toolbar locations. If we do it later
771 (after redisplay) we end up clearing what we have just
772 displayed. */
773 MAYBE_DEVMETH (d, clear_frame_toolbars, (f));
774 }
775 }
776
777 /* Actually redisplay the toolbar buttons. */
778 void
779 update_frame_toolbars (struct frame *f)
780 {
781 struct device *d = XDEVICE (f->device);
782
783 if (DEVICE_SUPPORTS_TOOLBARS_P (d)
784 && (f->toolbar_changed
785 || f->frame_layout_changed
786 || f->frame_changed
787 || f->clear))
788 {
755 DEVMETH (d, output_frame_toolbars, (f)); 789 DEVMETH (d, output_frame_toolbars, (f));
756 } 790 }
757 791
758 f->toolbar_changed = 0; 792 f->toolbar_changed = 0;
759 } 793 }