Mercurial > emacs
comparison src/widget.c @ 12188:06ef0aabc2bb
(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.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sun, 11 Jun 1995 20:26:47 +0000 |
parents | 942ad27b8e10 |
children | f6386ce0011c |
comparison
equal
deleted
inserted
replaced
12187:18d061c3d0dd | 12188:06ef0aabc2bb |
---|---|
475 XtVaSetValues (wmshell, XtNiconic, ew->emacs_frame.iconic, 0); | 475 XtVaSetValues (wmshell, XtNiconic, ew->emacs_frame.iconic, 0); |
476 #endif /* 0 */ | 476 #endif /* 0 */ |
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.) */ | |
482 int update_hints_inhibit; | |
480 | 483 |
481 static void | 484 static void |
482 update_wm_hints (ew) | 485 update_wm_hints (ew) |
483 EmacsFrame ew; | 486 EmacsFrame ew; |
484 { | 487 { |
491 int char_height; | 494 int char_height; |
492 int base_width; | 495 int base_width; |
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); |
500 char_to_pixel_size (ew, char_width, char_height, | 508 char_to_pixel_size (ew, char_width, char_height, |
501 &rounded_width, &rounded_height); | 509 &rounded_width, &rounded_height); |
899 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) | 907 ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
900 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->display.x->font))); | 908 : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->display.x->font))); |
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++; |
916 XtSetValues ((Widget) ew, al, ac); | 931 XtSetValues ((Widget) ew, al, ac); |
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); |
944 | |
945 update_hints_inhibit = 0; | |
946 update_wm_hints (ew); | |
923 | 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; |
927 } | 951 } |