From: Po Lu Date: Fri, 20 Dec 2024 03:22:22 +0000 (+0800) Subject: Enable adjusting frame sizes on MS-DOS X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f35fec993aa40d5adabb3abc8d084f0df93c78ac;p=emacs.git 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. (cherry picked from commit 3cb86eb0385b8d5edba3dea495bc086c009614b7) --- diff --git a/src/dispnew.c b/src/dispnew.c index 33caa6aca88..0137f66fbca 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6615,13 +6615,14 @@ change_frame_size (struct frame *f, int new_width, int new_height, { Lisp_Object tail, frame; - if (FRAME_MSDOS_P (f)) + if (FRAME_MSDOS_P (f) && !FRAME_PARENT_FRAME (f)) { /* On MS-DOS, all frames use the same screen, so a change in size affects all frames. Termcap now supports multiple ttys. */ FOR_EACH_FRAME (tail, frame) - if (!FRAME_WINDOW_P (XFRAME (frame))) + if (!FRAME_WINDOW_P (XFRAME (frame)) + && !FRAME_PARENT_FRAME (XFRAME (frame))) change_frame_size_1 (XFRAME (frame), new_width, new_height, pretend, delay, safe); } diff --git a/src/frame.c b/src/frame.c index d66723e78b8..8c41f0fa7c7 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, block_input (); #ifdef MSDOS - /* We only can set screen dimensions to certain values supported by - our video hardware. Try to find the smallest size greater or - equal to the requested dimensions, while accounting for the fact - that the menu-bar lines are not counted in the frame height. */ - int dos_new_text_lines = new_text_lines + FRAME_TOP_MARGIN (f); - - dos_set_window_size (&dos_new_text_lines, &new_text_cols); - new_text_lines = dos_new_text_lines - FRAME_TOP_MARGIN (f); + if (!FRAME_PARENT_FRAME (f)) + { + /* We only can set screen dimensions to certain values supported + by our video hardware. Try to find the smallest size greater + or equal to the requested dimensions, while accounting for the + fact that the menu-bar lines are not counted in the frame + height. */ + int dos_new_text_lines = new_text_lines + FRAME_TOP_MARGIN (f); + + dos_set_window_size (&dos_new_text_lines, &new_text_cols); + new_text_lines = dos_new_text_lines - FRAME_TOP_MARGIN (f); + } #endif if (new_inner_width != old_inner_width)