diff --git a/programs/wineconsole/curses.c b/programs/wineconsole/curses.c index 971c22d58d2..2210cd96404 100644 --- a/programs/wineconsole/curses.c +++ b/programs/wineconsole/curses.c @@ -1016,6 +1016,8 @@ enum init_return WCCURSES_InitBackend(struct inner_data* data) #else enum init_return WCCURSES_InitBackend(struct inner_data* data) { + WINE_ERR("(n)curses was not found at configuration time.\n" + "If you want (n)curses support, please install relevant packages.\n"); return init_not_supported; } #endif diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c index fdb0e16b35b..deba453abcd 100644 --- a/programs/wineconsole/user.c +++ b/programs/wineconsole/user.c @@ -1437,7 +1437,7 @@ enum init_return WCUSER_InitBackend(struct inner_data* data) CreateWindow(wndclass.lpszClassName, NULL, WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_HSCROLL|WS_VSCROLL, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, 0, 0, wndclass.hInstance, data); - if (!data->hWnd) return init_failed; + if (!data->hWnd) return init_not_supported; return init_success; } diff --git a/programs/wineconsole/wineconsole.c b/programs/wineconsole/wineconsole.c index 449cb646275..a78e07630ea 100644 --- a/programs/wineconsole/wineconsole.c +++ b/programs/wineconsole/wineconsole.c @@ -656,9 +656,18 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna WINE_TRACE("using hConOut %p\n", data->hConOut); /* filling data->curcfg from cfg */ - retry: switch ((*backend)(data)) { + case init_not_supported: + if (backend == WCCURSES_InitBackend) + { + if (WCUSER_InitBackend( data ) != init_success) break; + } + else if (backend == WCUSER_InitBackend) + { + if (WCCURSES_InitBackend( data ) != init_success) break; + } + /* fall through */ case init_success: WINECON_GetServerConfig(data); data->cells = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, @@ -684,16 +693,6 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna return data; case init_failed: break; - case init_not_supported: - if (backend == WCCURSES_InitBackend) - { - WINE_ERR("(n)curses was not found at configuration time.\n" - "If you want (n)curses support, please install relevant packages.\n" - "Now forcing user backend instead of (n)curses.\n"); - backend = WCUSER_InitBackend; - goto retry; - } - break; } error: @@ -768,7 +767,7 @@ static UINT WINECON_ParseOptions(const char* lpCmdLine, struct wc_init* wci) memset(wci, 0, sizeof(*wci)); wci->ptr = lpCmdLine; wci->mode = from_process_name; - wci->backend = WCCURSES_InitBackend; + wci->backend = WCUSER_InitBackend; for (;;) { @@ -792,6 +791,7 @@ static UINT WINECON_ParseOptions(const char* lpCmdLine, struct wc_init* wci) } else if (strncmp(wci->ptr + 10, "curses", 6) == 0) { + wci->backend = WCCURSES_InitBackend; wci->ptr += 16; } else