# HG changeset patch # User Jan Dj¸«£rv # Date 1238178655 0 # Node ID 9e4328a0286b54c1023c072c5bc7c936c0be29bd # Parent 364aae6e64028d24e44696c0ece6702d6f1e86ae (x_set_font): If the fullscreen property is non-nil, adjust lines and columns so we keep the same pixel height and width. diff -r 364aae6e6402 -r 9e4328a0286b src/frame.c --- a/src/frame.c Fri Mar 27 16:50:14 2009 +0000 +++ b/src/frame.c Fri Mar 27 18:30:55 2009 +0000 @@ -3422,7 +3422,25 @@ if (! NILP (Fequal (font_object, oldval))) return; + + + Lisp_Object lval = Fassq (Qfullscreen, f->param_alist); + if (CONSP (lval)) lval = CDR (lval); + x_new_font (f, font_object, fontset); + /* If the fullscreen property is non-nil, adjust lines and columns so we + keep the same pixel height and width. */ + if (! NILP (lval)) + { + int height = FRAME_LINES (f), width = FRAME_COLS (f); + if (EQ (lval, Qfullboth) || EQ (lval, Qfullwidth)) + width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f)); + if (EQ (lval, Qfullboth) || EQ (lval, Qfullheight)) + height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, FRAME_PIXEL_HEIGHT (f)); + + change_frame_size (f, height, width, 0, 0, 1); + } + store_frame_param (f, Qfont, arg); /* Recalculate toolbar height. */ f->n_tool_bar_rows = 0;