Changelog: dlls/gdi/driver.c: load_display_driver dlls/user/user_main.c: load_driver Fall back to ttydrv when DISPLAY variable is not set, and the user allowed this with the config entry [wine] "TTYdrvFallback"= "Y" As in my second attempt, this message doesn't appear, when ttydrv is configured. The message itself now the situation explains more, as to Andi's request. -- Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ---------- Index: wine/documentation/samples/config =================================================================== RCS file: /home/wine/wine/documentation/samples/config,v retrieving revision 1.43 diff -u -r1.43 config --- wine/documentation/samples/config 7 Apr 2003 23:27:54 -0000 1.43 +++ wine/documentation/samples/config 15 Apr 2003 11:05:08 -0000 @@ -63,6 +63,8 @@ "Path" = "c:\\windows;c:\\windows\\system;e:\\;e:\\test;f:\\" "Profile" = "c:\\windows\\Profiles\\Administrator" "GraphicsDriver" = "x11drv" +;When X is not available, but x11drv set, allow fallback to ttydrv +;"TTYdrvFallback" = "y" ;"ShowDirSymlinks" = "1" ;"ShowDotFiles" = "1" "ShellLinker" = "wineshelllink" Index: wine/dlls/user/user_main.c =================================================================== RCS file: /home/wine/wine/dlls/user/user_main.c,v retrieving revision 1.50 diff -u -r1.50 user_main.c --- wine/dlls/user/user_main.c 3 Dec 2002 23:34:54 -0000 1.50 +++ wine/dlls/user/user_main.c 15 Apr 2003 11:05:08 -0000 @@ -58,7 +58,7 @@ /* load the graphics driver */ static BOOL load_driver(void) { - char buffer[MAX_PATH]; + char buffer[MAX_PATH], buffer1[MAX_PATH], buffer2[MAX_PATH]; HKEY hkey; DWORD type, count; @@ -67,8 +67,20 @@ { count = sizeof(buffer); RegQueryValueExA( hkey, "GraphicsDriver", 0, &type, buffer, &count ); + count = sizeof(buffer2); + RegQueryValueExA( hkey, "TTYdrvFallback", 0, &type, buffer2, &count ); RegCloseKey( hkey ); } + + if (!strcasecmp("x11drv",buffer) && + (GetEnvironmentVariableA("DISPLAY",buffer1,MAX_PATH-1) == 0) && + !strcasecmp("y",buffer2)) + { + + MESSAGE( "$DISPLAY not set, but x11drv requested\n"); + MESSAGE( "Falling back to ttydrv as directed by TTYdrvFallback config option\n"); + strcpy( buffer, "ttydrv" ); /* default value */ + } if (!(graphics_driver = LoadLibraryA( buffer ))) { Index: wine/dlls/gdi/driver.c =================================================================== RCS file: /home/wine/wine/dlls/gdi/driver.c,v retrieving revision 1.21 diff -u -r1.21 driver.c --- wine/dlls/gdi/driver.c 1 Apr 2003 00:12:50 -0000 1.21 +++ wine/dlls/gdi/driver.c 15 Apr 2003 11:05:08 -0000 @@ -190,7 +190,7 @@ */ static struct graphics_driver *load_display_driver(void) { - char buffer[MAX_PATH]; + char buffer[MAX_PATH], buffer1[MAX_PATH], buffer2[MAX_PATH]; HMODULE module; HKEY hkey; @@ -205,8 +205,19 @@ { DWORD type, count = sizeof(buffer); RegQueryValueExA( hkey, "GraphicsDriver", 0, &type, buffer, &count ); + count = sizeof(buffer2); + RegQueryValueExA( hkey, "TTYdrvFallback", 0, &type, buffer2, &count ); RegCloseKey( hkey ); } + + if (!strcasecmp("x11drv",buffer) && + (GetEnvironmentVariableA("DISPLAY",buffer1,MAX_PATH-1) == 0) && + !strcasecmp("y",buffer2)) + { + MESSAGE( "$DISPLAY not set, but x11drv requested\n"); + MESSAGE( "Falling back to ttydrv as directed by TTYdrvFallback config option\n"); + strcpy( buffer, "ttydrv" ); /* default value */ + } if (!(module = LoadLibraryA( buffer ))) {