summaryrefslogtreecommitdiff
path: root/src/widget.c
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1995-06-11 20:26:47 +0000
committerKarl Heuer <kwzh@gnu.org>1995-06-11 20:26:47 +0000
commit72d4174fcc3d0538e84009c4ec367e38348f5aa9 (patch)
tree30401e8b43897a1fa499a37b5e2a950b736be51d /src/widget.c
parent8ab48489a6be96b702abe92d05ed5f82a8484f2c (diff)
downloademacs-72d4174fcc3d0538e84009c4ec367e38348f5aa9.tar.gz
(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/widget.c')
-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)
}
}
+/* 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;