diff options
| author | Po Lu | 2024-12-20 11:22:22 +0800 |
|---|---|---|
| committer | Po Lu | 2024-12-20 11:22:22 +0800 |
| commit | 3cb86eb0385b8d5edba3dea495bc086c009614b7 (patch) | |
| tree | ff751dcfd517ecd28870c03d8a304f7cf569c2d0 /src | |
| parent | cc5afea98e8efb1a04baedf98e66863d31974ae6 (diff) | |
| download | emacs-3cb86eb0385b8d5edba3dea495bc086c009614b7.tar.gz emacs-3cb86eb0385b8d5edba3dea495bc086c009614b7.zip | |
Enable adjusting frame sizes on MS-DOS
* src/dispnew.c (change_frame_size): Do not propagate changes to
child frames to root frames and vice versa.
* src/frame.c (adjust_frame_size): Do not change video modes
in resizing a child frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 5 | ||||
| -rw-r--r-- | src/frame.c | 20 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 180bc173f31..c252781b235 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -6618,13 +6618,14 @@ change_frame_size (struct frame *f, int new_width, int new_height, | |||
| 6618 | { | 6618 | { |
| 6619 | Lisp_Object tail, frame; | 6619 | Lisp_Object tail, frame; |
| 6620 | 6620 | ||
| 6621 | if (FRAME_MSDOS_P (f)) | 6621 | if (FRAME_MSDOS_P (f) && !FRAME_PARENT_FRAME (f)) |
| 6622 | { | 6622 | { |
| 6623 | /* On MS-DOS, all frames use the same screen, so a change in | 6623 | /* On MS-DOS, all frames use the same screen, so a change in |
| 6624 | size affects all frames. Termcap now supports multiple | 6624 | size affects all frames. Termcap now supports multiple |
| 6625 | ttys. */ | 6625 | ttys. */ |
| 6626 | FOR_EACH_FRAME (tail, frame) | 6626 | FOR_EACH_FRAME (tail, frame) |
| 6627 | if (!FRAME_WINDOW_P (XFRAME (frame))) | 6627 | if (!FRAME_WINDOW_P (XFRAME (frame)) |
| 6628 | && !FRAME_PARENT_FRAME (XFRAME (frame))) | ||
| 6628 | change_frame_size_1 (XFRAME (frame), new_width, new_height, | 6629 | change_frame_size_1 (XFRAME (frame), new_width, new_height, |
| 6629 | pretend, delay, safe); | 6630 | pretend, delay, safe); |
| 6630 | } | 6631 | } |
diff --git a/src/frame.c b/src/frame.c index 250e7e53dd4..18e1078efe4 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -837,14 +837,18 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height, | |||
| 837 | block_input (); | 837 | block_input (); |
| 838 | 838 | ||
| 839 | #ifdef MSDOS | 839 | #ifdef MSDOS |
| 840 | /* We only can set screen dimensions to certain values supported by | 840 | if (!FRAME_PARENT_FRAME (f)) |
| 841 | our video hardware. Try to find the smallest size greater or | 841 | { |
| 842 | equal to the requested dimensions, while accounting for the fact | 842 | /* We only can set screen dimensions to certain values supported |
| 843 | that the menu-bar lines are not counted in the frame height. */ | 843 | by our video hardware. Try to find the smallest size greater |
| 844 | int dos_new_text_lines = new_text_lines + FRAME_TOP_MARGIN (f); | 844 | or equal to the requested dimensions, while accounting for the |
| 845 | 845 | fact that the menu-bar lines are not counted in the frame | |
| 846 | dos_set_window_size (&dos_new_text_lines, &new_text_cols); | 846 | height. */ |
| 847 | new_text_lines = dos_new_text_lines - FRAME_TOP_MARGIN (f); | 847 | int dos_new_text_lines = new_text_lines + FRAME_TOP_MARGIN (f); |
| 848 | |||
| 849 | dos_set_window_size (&dos_new_text_lines, &new_text_cols); | ||
| 850 | new_text_lines = dos_new_text_lines - FRAME_TOP_MARGIN (f); | ||
| 851 | } | ||
| 848 | #endif | 852 | #endif |
| 849 | 853 | ||
| 850 | if (new_inner_width != old_inner_width) | 854 | if (new_inner_width != old_inner_width) |