if ((cfg.lockfont && reinit==0) || reinit>0) {
if ((cfg.resize_action != RESIZE_FONT  && reinit==0) || reinit>0) {
static void reset_window(int reinit) {    /*     * This function decides how to resize or redraw when the      * user changes something.      *     * This function doesn't like to change the terminal size but if the     * font size is locked that may be it's only soluion.     */    int win_width, win_height;    RECT cr, wr;#ifdef RDB_DEBUG_PATCH    debug((27, "reset_window()"));#endif    /* Current window sizes ... */    GetWindowRect(hwnd, &wr);    GetClientRect(hwnd, &cr);    win_width  = cr.right - cr.left;    win_height = cr.bottom - cr.top;    /* Are we being forced to reload the fonts ? */    if (reinit>1) {#ifdef RDB_DEBUG_PATCH	debug((27, "reset_window() -- Forced deinit"));#endif	deinit_fonts();	init_fonts(0,0);    }    /* Oh, looks like we're minimised */    if (win_width == 0 || win_height == 0)	return;    /* Is the window out of position ? */    if ( !reinit && 	    (offset_width != (win_width-font_width*cols)/2 ||	     offset_height != (win_height-font_height*rows)/2) ){	offset_width = (win_width-font_width*cols)/2;	offset_height = (win_height-font_height*rows)/2;	InvalidateRect(hwnd, NULL, TRUE);#ifdef RDB_DEBUG_PATCH	debug((27, "reset_window() -> Reposition terminal"));#endif    }    if (IsZoomed(hwnd)) {	/* We're fullscreen, this means we must not change the size of	 * the window so it's the font size or the terminal itself.	 */	extra_width = wr.right - wr.left - cr.right + cr.left;	extra_height = wr.bottom - wr.top - cr.bottom + cr.top;	if (!cfg.lockfont) {	    if (  font_width != win_width/cols || 		  font_height != win_height/rows) {		deinit_fonts();		init_fonts(win_width/cols, win_height/rows);		offset_width = (win_width-font_width*cols)/2;		offset_height = (win_height-font_height*rows)/2;		InvalidateRect(hwnd, NULL, TRUE);#ifdef RDB_DEBUG_PATCH		debug((25, "reset_window() -> Z font resize to (%d, %d)",			font_width, font_height));#endif	    }	} else {	    if (  font_width != win_width/cols || 		  font_height != win_height/rows) {		/* Our only choice at this point is to change the 		 * size of the terminal; Oh well.		 */		term_size( win_height/font_height, win_width/font_width,			   cfg.savelines);		offset_width = (win_width-font_width*cols)/2;		offset_height = (win_height-font_height*rows)/2;		InvalidateRect(hwnd, NULL, TRUE);#ifdef RDB_DEBUG_PATCH		debug((27, "reset_window() -> Zoomed term_size"));#endif	    }	}	return;    }    /* Hmm, a force re-init means we should ignore the current window     * so we resize to the default font size.     */    if (reinit>0) {#ifdef RDB_DEBUG_PATCH	debug((27, "reset_window() -> Forced re-init"));#endif	offset_width = offset_height = cfg.window_border;	extra_width = wr.right - wr.left - cr.right + cr.left + offset_width*2;	extra_height = wr.bottom - wr.top - cr.bottom + cr.top +offset_height*2;	if (win_width != font_width*cols + offset_width*2 ||	    win_height != font_height*rows + offset_height*2) {	    /* If this is too large windows will resize it to the maximum	     * allowed window size, we will then be back in here and resize	     * the font or terminal to fit.	     */	    SetWindowPos(hwnd, NULL, 0, 0, 		         font_width*cols + extra_width, 			 font_height*rows + extra_height,			 SWP_NOMOVE | SWP_NOZORDER);	}	return;    }    /* Okay the user doesn't want us to change the font so we try the      * window. But that may be too big for the screen which forces us     * to change the terminal.     */    if ((cfg.lockfont && reinit==0) || reinit>0) {	offset_width = offset_height = cfg.window_border;	extra_width = wr.right - wr.left - cr.right + cr.left + offset_width*2;	extra_height = wr.bottom - wr.top - cr.bottom + cr.top +offset_height*2;	if (win_width != font_width*cols + offset_width*2 ||	    win_height != font_height*rows + offset_height*2) {	    static RECT ss;	    int width, height;	    GetClientRect(GetDesktopWindow(), &ss);	    width = (ss.right - ss.left - extra_width) / font_width;	    height = (ss.bottom - ss.top - extra_height) / font_height;	    /* Grrr too big */	    if ( rows > height || cols > width ) {		if ( height > rows ) height = rows;		if ( width > cols )  width = cols;		term_size(height, width, cfg.savelines);#ifdef RDB_DEBUG_PATCH		debug((27, "reset_window() -> term resize to (%d,%d)",			   height, width));#endif	    }	    	    SetWindowPos(hwnd, NULL, 0, 0, 		         font_width*cols + extra_width, 			 font_height*rows + extra_height,			 SWP_NOMOVE | SWP_NOZORDER);	    InvalidateRect(hwnd, NULL, TRUE);#ifdef RDB_DEBUG_PATCH	    debug((27, "reset_window() -> window resize to (%d,%d)",			font_width*cols + extra_width,			font_height*rows + extra_height));#endif	}	return;    }    /* We're allowed to or must change the font but do we want to ?  */    if (font_width != (win_width-cfg.window_border*2)/cols || 	font_height != (win_height-cfg.window_border*2)/rows) {	deinit_fonts();	init_fonts((win_width-cfg.window_border*2)/cols, 		   (win_height-cfg.window_border*2)/rows);	offset_width = (win_width-font_width*cols)/2;	offset_height = (win_height-font_height*rows)/2;	extra_width = wr.right - wr.left - cr.right + cr.left +offset_width*2;	extra_height = wr.bottom - wr.top - cr.bottom + cr.top+offset_height*2;	InvalidateRect(hwnd, NULL, TRUE);#ifdef RDB_DEBUG_PATCH	debug((25, "reset_window() -> font resize to (%d,%d)", 		   font_width, font_height));#endif    }}