From cfcd12d6752021ee525325313a8c0c666e3a922e Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sun, 11 Jun 1995 20:26:47 +0000 Subject: [PATCH] (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. --- src/widget.c | 28 ++++++++++++++++++++++++++-- 1 file 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) } } +/* Nonzero tells update_wm_hints not to do anything + (the caller should call update_wm_hints explicitly later.) */ +int update_hints_inhibit; static void update_wm_hints (ew) @@ -493,7 +496,12 @@ update_wm_hints (ew) int base_height; int min_rows = 0, min_cols = 0; + if (update_hints_inhibit) + return; + +#if 0 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); +#endif pixel_to_char_size (ew, ew->core.width, ew->core.height, &char_width, &char_height); @@ -901,15 +909,22 @@ EmacsFrameSetCharSize (widget, columns, rows) char_to_pixel_size (ew, columns, rows, &pixel_width, &pixel_height); - /* Recompute the entire geometry management. */ + /* Manually change the height and width of all our widgets, + adjusting each widget by the same increments. */ if (ew->core.width != pixel_width || ew->core.height != pixel_height) { int hdelta = pixel_height - ew->core.height; + int wdelta = pixel_width - ew->core.width; int column_widget_height = f->display.x->column_widget->core.height; + int column_widget_width = f->display.x->column_widget->core.width; + int outer_widget_height = f->display.x->widget->core.height; + int outer_widget_width = f->display.x->widget->core.width; int old_left = f->display.x->widget->core.x; int old_top = f->display.x->widget->core.y; lw_refigure_widget (f->display.x->column_widget, False); + update_hints_inhibit = 1; + ac = 0; XtSetArg (al[ac], XtNheight, pixel_height); ac++; XtSetArg (al[ac], XtNwidth, pixel_width); ac++; @@ -917,10 +932,19 @@ EmacsFrameSetCharSize (widget, columns, rows) ac = 0; XtSetArg (al[ac], XtNheight, column_widget_height + hdelta); ac++; - XtSetArg (al[ac], XtNwidth, pixel_width); ac++; + XtSetArg (al[ac], XtNwidth, column_widget_width + wdelta); ac++; XtSetValues (f->display.x->column_widget, al, ac); + + ac = 0; + XtSetArg (al[ac], XtNheight, outer_widget_height + hdelta); ac++; + XtSetArg (al[ac], XtNwidth, outer_widget_width + wdelta); ac++; + XtSetValues (f->display.x->widget, al, ac); + lw_refigure_widget (f->display.x->column_widget, True); + update_hints_inhibit = 0; + update_wm_hints (ew); + /* These seem to get clobbered. I don't know why. - rms. */ f->display.x->widget->core.x = old_left; f->display.x->widget->core.y = old_top; -- 2.39.2