diff options
author | marha <marha@users.sourceforge.net> | 2009-11-13 10:34:48 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-11-13 10:34:48 +0000 |
commit | 1bcef59bbedd82ffa99250015337b2c5ca4dc0f2 (patch) | |
tree | 589fddbc636d92a21808f3d1ce0bb6ba25ac87d1 | |
parent | 98ae64698e3d57f5f740ed6fdadddcbf96007efd (diff) | |
download | vcxsrv-1bcef59bbedd82ffa99250015337b2c5ca4dc0f2.tar.gz vcxsrv-1bcef59bbedd82ffa99250015337b2c5ca4dc0f2.tar.bz2 vcxsrv-1bcef59bbedd82ffa99250015337b2c5ca4dc0f2.zip |
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) )
-rw-r--r-- | xorg-server/dix/main.c | 14 |
1 files changed, 14 insertions, 0 deletions
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(); |