From 6f910f95f4c468b07c67ae182d5f6ebac145338d Mon Sep 17 00:00:00 2001 From: Hugh McMaster Date: Wed, 24 Apr 2013 16:10:29 +1000 Subject: wineconsole.c --- programs/wineconsole/wineconsole.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index d298705..5b36c7f 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -576,6 +576,8 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna DWORD ret; struct config_data cfg; STARTUPINFOW si; + RECT workarea; + int max_width = 0, max_height = 0; data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data)); if (!data) return 0; @@ -592,6 +594,38 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna /* load settings */ WINECON_RegLoad(appname, &cfg); + /* send active font size to server */ + SERVER_START_REQ(console_font_size) + { + req->mem = 1; + req->font_w = cfg.cell_width; + req->font_h = cfg.cell_height; + wine_server_call(req); + } + SERVER_END_REQ; + + /* calculate largest possible console window size */ + SystemParametersInfoW(SPI_GETWORKAREA, 0, &workarea, 0); + + max_width = (workarea.right / cfg.cell_width) - 6; + max_height = (workarea.bottom / cfg.cell_height) - 5; + + if (max_width < 0 || max_height < 0) + { + max_width = 80; + max_height = 25; + } + + /* send largest possible console window size to server */ + SERVER_START_REQ(max_console_size) + { + req->mem = 1; + req->max_w = max_width; + req->max_h = max_height; + wine_server_call(req); + } + SERVER_END_REQ; + /* some overrides */ if (pid == 0) { -- 1.7.10.4