aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-06-11 20:26:47 +0000
committerKarl Heuer1995-06-11 20:26:47 +0000
commitcfcd12d6752021ee525325313a8c0c666e3a922e (patch)
tree0d80d5fee1947b812beb75d98b75e26787a1be6b /src
parent99dcca2febbaf4f1c9a95e18ba25810facc7662a (diff)
downloademacs-cfcd12d6752021ee525325313a8c0c666e3a922e.tar.gz
emacs-cfcd12d6752021ee525325313a8c0c666e3a922e.zip
(EmacsFrameSetCharSize): Manually alter the height
and width of the outer widget (and the width of the column widget) carefully using deltas. Set update_hints_inhibit nonzero while updating. Then call update_wm_hints explicitly. (update_wm_hints): Use 0 for min_rows, min_cols. Do nothing if update_hints_inhibit is nonzero.
Diffstat (limited to 'src')
-rw-r--r--src/widget.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/widget.c b/src/widget.c
index 32daf8ffc27..a18073313dc 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -477,6 +477,9 @@ set_frame_size (ew)
477 } 477 }
478} 478}
479 479
480/* Nonzero tells update_wm_hints not to do anything
481 (the caller should call update_wm_hints explicitly later.) */
482int update_hints_inhibit;
480 483
481static void 484static void
482update_wm_hints (ew) 485update_wm_hints (ew)
@@ -493,7 +496,12 @@ update_wm_hints (ew)
493 int base_height; 496 int base_height;
494 int min_rows = 0, min_cols = 0; 497 int min_rows = 0, min_cols = 0;
495 498
499 if (update_hints_inhibit)
500 return;
501
502#if 0
496 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); 503 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols);
504#endif
497 505
498 pixel_to_char_size (ew, ew->core.width, ew->core.height, 506 pixel_to_char_size (ew, ew->core.width, ew->core.height,
499 &char_width, &char_height); 507 &char_width, &char_height);
@@ -901,15 +909,22 @@ EmacsFrameSetCharSize (widget, columns, rows)
901 909
902 char_to_pixel_size (ew, columns, rows, &pixel_width, &pixel_height); 910 char_to_pixel_size (ew, columns, rows, &pixel_width, &pixel_height);
903 911
904 /* Recompute the entire geometry management. */ 912 /* Manually change the height and width of all our widgets,
913 adjusting each widget by the same increments. */
905 if (ew->core.width != pixel_width || ew->core.height != pixel_height) 914 if (ew->core.width != pixel_width || ew->core.height != pixel_height)
906 { 915 {
907 int hdelta = pixel_height - ew->core.height; 916 int hdelta = pixel_height - ew->core.height;
917 int wdelta = pixel_width - ew->core.width;
908 int column_widget_height = f->display.x->column_widget->core.height; 918 int column_widget_height = f->display.x->column_widget->core.height;
919 int column_widget_width = f->display.x->column_widget->core.width;
920 int outer_widget_height = f->display.x->widget->core.height;
921 int outer_widget_width = f->display.x->widget->core.width;
909 int old_left = f->display.x->widget->core.x; 922 int old_left = f->display.x->widget->core.x;
910 int old_top = f->display.x->widget->core.y; 923 int old_top = f->display.x->widget->core.y;
911 924
912 lw_refigure_widget (f->display.x->column_widget, False); 925 lw_refigure_widget (f->display.x->column_widget, False);
926 update_hints_inhibit = 1;
927
913 ac = 0; 928 ac = 0;
914 XtSetArg (al[ac], XtNheight, pixel_height); ac++; 929 XtSetArg (al[ac], XtNheight, pixel_height); ac++;
915 XtSetArg (al[ac], XtNwidth, pixel_width); ac++; 930 XtSetArg (al[ac], XtNwidth, pixel_width); ac++;
@@ -917,10 +932,19 @@ EmacsFrameSetCharSize (widget, columns, rows)
917 932
918 ac = 0; 933 ac = 0;
919 XtSetArg (al[ac], XtNheight, column_widget_height + hdelta); ac++; 934 XtSetArg (al[ac], XtNheight, column_widget_height + hdelta); ac++;
920 XtSetArg (al[ac], XtNwidth, pixel_width); ac++; 935 XtSetArg (al[ac], XtNwidth, column_widget_width + wdelta); ac++;
921 XtSetValues (f->display.x->column_widget, al, ac); 936 XtSetValues (f->display.x->column_widget, al, ac);
937
938 ac = 0;
939 XtSetArg (al[ac], XtNheight, outer_widget_height + hdelta); ac++;
940 XtSetArg (al[ac], XtNwidth, outer_widget_width + wdelta); ac++;
941 XtSetValues (f->display.x->widget, al, ac);
942
922 lw_refigure_widget (f->display.x->column_widget, True); 943 lw_refigure_widget (f->display.x->column_widget, True);
923 944
945 update_hints_inhibit = 0;
946 update_wm_hints (ew);
947
924 /* These seem to get clobbered. I don't know why. - rms. */ 948 /* These seem to get clobbered. I don't know why. - rms. */
925 f->display.x->widget->core.x = old_left; 949 f->display.x->widget->core.x = old_left;
926 f->display.x->widget->core.y = old_top; 950 f->display.x->widget->core.y = old_top;