> Everything looks good. Your patch still applies fine and fixes the face > background crash, and your commit fixes the terminal emacsclient display > issue. OK. This was part one of our endeavour. We now have to discuss with Eli on how to proceed. The current patch has three advantages: (1) It doesn't violate the uniform interface where all calls to change_frame_size and adjust_frame_size use the window's text sizes as arguments. (2) It doesn't require any change in window.c. (3) It has been tested. It has the following disadvantages: (1) Code changes in term.c and w32console.c from FRAME_LINES to FRAME_TOTAL_LINES. (2) change_frame_size and adjust_frame_size must be explicitly called with FRAME_MENU_BAR_LINES subtracted after calling get_tty_size. Alternatively, I could try to do what I mentioned earlier: Change the definition of FRAME_TOP_MARGIN and FRAME_TOP_MARGIN_HEIGHT so that these do not count the menubar for TTY frames. This means that I would have to check every use of these macros for whether the underlying system is a TTY or not. This solution would have the following advantages: (1) Code in term.c and w32console.c would remain unchanged. (2) The calls of change_frame_size and adjust_frame_size after a get_tty_size would remain unchanged. Disadvantages are: (1) Code in window.c would have to be special cased for TTY: Affected are Fdelete_other_windows_internal, Fwindow_resize_apply_total and resize_frame_windows. (2) I don't yet know how the two uses of FRAME_TOP_MARGIN in dispnew.c would be affected. I suspect that something there might be fishy anyway without any visible consequences but am too silly to understand it. (3) The semantics of the size arguments in change_frame_size and adjust_frame_size would become inconsistent wrt GUI builds. We'd include the menubar for TTYs and exclude them for GUIs. (4) We'd have to specially mention TTYs in all documentations of frame size parameters and functions setting or querying the size of frames. Personally, I think that the real show-stopper here is (4). One major aim of adjust_frame_size was to provide a unified concept where functions like `frame-text-height' and `set-frame-height' conceptually do not count menu and tool bars throughout all builds, that is, always refer to the "same object". In any case I once more attach the patch I posted earlier. Mat could you try whether it solves Bug#18161 for you? martin