Mercurial > hg > xemacs-beta
comparison src/toolbar.c @ 1559:9bf5135fc04f
[xemacs-hg @ 2003-07-04 07:16:25 by michaels]
2003-07-02 Mike Sperber <mike@xemacs.org>
* toolbar.c (update_frame_toolbars_geometry): Update the frame
size when correct information to compute it is actually available.
Moreover, do it right via the frame method if it's available.
author | michaels |
---|---|
date | Fri, 04 Jul 2003 07:16:26 +0000 |
parents | b531bf8658e9 |
children | 04bc9d2f42c7 |
comparison
equal
deleted
inserted
replaced
1558:2a1866f3e7c0 | 1559:9bf5135fc04f |
---|---|
748 && (f->toolbar_changed | 748 && (f->toolbar_changed |
749 || f->frame_layout_changed | 749 || f->frame_layout_changed |
750 || f->frame_changed | 750 || f->frame_changed |
751 || f->clear)) | 751 || f->clear)) |
752 { | 752 { |
753 int pos; | 753 int pos, frame_size_changed = 0; |
754 | 754 |
755 /* We're not officially "in redisplay", so we still have a | 755 /* We're not officially "in redisplay", so we still have a |
756 chance to re-layout toolbars and windows. This is done here, | 756 chance to re-layout toolbars and windows. This is done here, |
757 because toolbar is the only thing which currently might | 757 because toolbar is the only thing which currently might |
758 necessitate this layout, as it is outside any windows. We | 758 necessitate this layout, as it is outside any windows. We |
761 multiple of character sizes. */ | 761 multiple of character sizes. */ |
762 | 762 |
763 for (pos = 0; pos < 4; pos++) | 763 for (pos = 0; pos < 4; pos++) |
764 if (FRAME_REAL_TOOLBAR_SIZE (f, pos) | 764 if (FRAME_REAL_TOOLBAR_SIZE (f, pos) |
765 != FRAME_CURRENT_TOOLBAR_SIZE (f, pos)) | 765 != FRAME_CURRENT_TOOLBAR_SIZE (f, pos)) |
766 { | 766 frame_size_changed = 1; |
767 int width, height; | |
768 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), | |
769 &width, &height); | |
770 change_frame_size (f, height, width, 0); | |
771 MARK_FRAME_LAYOUT_CHANGED (f); | |
772 break; | |
773 } | |
774 | 767 |
775 for (pos = 0; pos < 4; pos++) { | 768 for (pos = 0; pos < 4; pos++) { |
776 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); | 769 f->current_toolbar_size[pos] = FRAME_REAL_TOOLBAR_SIZE (f, pos); |
777 } | 770 } |
778 | 771 |
779 /* Removed the check for the minibuffer here. We handle this | 772 /* Removed the check for the minibuffer here. We handle this |
780 more correctly now by consistently using | 773 more correctly now by consistently using |
781 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW | 774 FRAME_LAST_NONMINIBUF_WINDOW instead of FRAME_SELECTED_WINDOW |
782 throughout the toolbar code. */ | 775 throughout the toolbar code. */ |
783 compute_frame_toolbars_data (f); | 776 compute_frame_toolbars_data (f); |
777 | |
778 if (frame_size_changed) | |
779 { | |
780 int width, height; | |
781 pixel_to_char_size (f, FRAME_PIXWIDTH (f), FRAME_PIXHEIGHT (f), | |
782 &width, &height); | |
783 if (!HAS_FRAMEMETH_P (f, set_frame_size)) | |
784 change_frame_size (f, height, width, 0); | |
785 else | |
786 FRAMEMETH (f, set_frame_size, (f, width, height)); | |
787 MARK_FRAME_LAYOUT_CHANGED (f); | |
788 } | |
784 | 789 |
785 /* Clear the previous toolbar locations. If we do it later | 790 /* Clear the previous toolbar locations. If we do it later |
786 (after redisplay) we end up clearing what we have just | 791 (after redisplay) we end up clearing what we have just |
787 displayed. */ | 792 displayed. */ |
788 MAYBE_DEVMETH (d, clear_frame_toolbars, (f)); | 793 MAYBE_DEVMETH (d, clear_frame_toolbars, (f)); |
794 | |
789 } | 795 } |
790 } | 796 } |
791 | 797 |
792 /* Actually redisplay the toolbar buttons. */ | 798 /* Actually redisplay the toolbar buttons. */ |
793 void | 799 void |