From 1bcef59bbedd82ffa99250015337b2c5ca4dc0f2 Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 13 Nov 2009 10:34:48 +0000 Subject: Change the current directory to the directory where the vcxsrv.exe is located. This is to make sure the standard fonts are loaded (the standard font path is referenced agains the . (current directory) ) --- xorg-server/dix/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c index 24aa7b6c0..fa65a4051 100644 --- a/xorg-server/dix/main.c +++ b/xorg-server/dix/main.c @@ -159,6 +159,20 @@ int main(int argc, char *argv[], char *envp[]) XInitThreads has to be called before any xlib function is called (aoccording to the man page) */ XInitThreads(); + /* change the current directory to the directory where the vcxsrv.exe executable is installed. + This is needed because the font directories are relative to the current directory. + */ + { + char ModuleFilename[MAX_PATH]; + char *pSlash; + GetModuleFileName(NULL,ModuleFilename,sizeof(ModuleFilename)); + pSlash=strrchr(ModuleFilename,'\\'); + if (pSlash) + { + *pSlash='\0'; + chdir(ModuleFilename); + } + } #endif InitRegions(); -- cgit v1.2.3