XSDL: use /proc/self/cwd as data dir for libX11
This commit is contained in:
Submodule project/jni/application/commandergenius/commandergenius updated: 444be3fa55...1180081202
Submodule project/jni/application/hid-pc-keyboard/src updated: 2f7672c980...c0a12cb31d
Submodule project/jni/application/xserver-debian/xserver updated: 58c205cd11...ce2611df11
Submodule project/jni/application/xserver-gimp/xserver updated: 58c205cd11...ce2611df11
@@ -7,10 +7,10 @@ AppName="XServer XSDL"
|
|||||||
AppFullName=x.org.server
|
AppFullName=x.org.server
|
||||||
|
|
||||||
# Application version code (integer)
|
# Application version code (integer)
|
||||||
AppVersionCode=11118
|
AppVersionCode=11119
|
||||||
|
|
||||||
# Application user-visible version name (string)
|
# Application user-visible version name (string)
|
||||||
AppVersionName="1.11.18"
|
AppVersionName="1.11.19"
|
||||||
|
|
||||||
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
# Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
|
||||||
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
# If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu
|
||||||
|
|||||||
@@ -26,11 +26,12 @@ cd android
|
|||||||
} || exit 1
|
} || exit 1
|
||||||
cd $1
|
cd $1
|
||||||
[ -e libfontenc-*/Makefile ] && {
|
[ -e libfontenc-*/Makefile ] && {
|
||||||
grep "/data/data/$PACKAGE_NAME" libfontenc-*/Makefile || \
|
grep "/proc/self/cwd" libfontenc-*/Makefile || \
|
||||||
git clean -f -d -x .
|
git clean -f -d -x .
|
||||||
}
|
}
|
||||||
|
|
||||||
env TARGET_DIR=/data/data/$PACKAGE_NAME/files \
|
# Megahack: set /proc/self/cwd as the X.org data dir, and chdir() to the correct directory when runngin X.org
|
||||||
|
env TARGET_DIR=/proc/self/cwd \
|
||||||
./build.sh || exit 1
|
./build.sh || exit 1
|
||||||
|
|
||||||
env CURDIR=$CURDIR \
|
env CURDIR=$CURDIR \
|
||||||
|
|||||||
@@ -699,6 +699,7 @@ void showErrorMessage(const char *msg)
|
|||||||
|
|
||||||
void XSDL_initSDL()
|
void XSDL_initSDL()
|
||||||
{
|
{
|
||||||
|
char fontpath[PATH_MAX];
|
||||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
|
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
|
||||||
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Current video mode: %d %d", SDL_ListModes(NULL, 0)[0]->w, SDL_ListModes(NULL, 0)[0]->h);
|
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Current video mode: %d %d", SDL_ListModes(NULL, 0)[0]->w, SDL_ListModes(NULL, 0)[0]->h);
|
||||||
@@ -708,7 +709,9 @@ void XSDL_initSDL()
|
|||||||
else
|
else
|
||||||
SDL_SetVideoMode(VID_Y, VID_X, 0, SDL_SWSURFACE);
|
SDL_SetVideoMode(VID_Y, VID_X, 0, SDL_SWSURFACE);
|
||||||
TTF_Init();
|
TTF_Init();
|
||||||
sFont = TTF_OpenFont("DroidSansMono.ttf", 14);
|
strcpy( fontpath, getenv("UNSECURE_STORAGE_DIR") );
|
||||||
|
strcat( fontpath, "/DroidSansMono.ttf" );
|
||||||
|
sFont = TTF_OpenFont(fontpath, 14);
|
||||||
if (!sFont)
|
if (!sFont)
|
||||||
{
|
{
|
||||||
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Error: cannot open font file, please reinstall the app");
|
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Error: cannot open font file, please reinstall the app");
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ int main( int argc, char* argv[] )
|
|||||||
getenv("SECURE_STORAGE_DIR"),
|
getenv("SECURE_STORAGE_DIR"),
|
||||||
getenv("SECURE_STORAGE_DIR") );
|
getenv("SECURE_STORAGE_DIR") );
|
||||||
|
|
||||||
XSDL_generateBackground(port, printHelp, resolutionW, resolutionH);
|
XSDL_generateBackground( port, printHelp, resolutionW, resolutionH );
|
||||||
|
|
||||||
XSDL_deinitSDL();
|
XSDL_deinitSDL();
|
||||||
|
|
||||||
@@ -155,14 +155,14 @@ int main( int argc, char* argv[] )
|
|||||||
|
|
||||||
if( printHelp )
|
if( printHelp )
|
||||||
{
|
{
|
||||||
sprintf( clientcmd, "%s/usr/bin/xhost + ; %s/usr/bin/xli -onroot -center background.bmp",
|
sprintf( clientcmd, "%s/usr/bin/xhost + ; %s/usr/bin/xli -onroot -center %s/background.bmp",
|
||||||
getenv("SECURE_STORAGE_DIR"), getenv("SECURE_STORAGE_DIR") );
|
getenv("SECURE_STORAGE_DIR"), getenv("SECURE_STORAGE_DIR"), getenv("UNSECURE_STORAGE_DIR") );
|
||||||
args[argnum] = "-exec";
|
args[argnum] = "-exec";
|
||||||
args[argnum+1] = clientcmd;
|
args[argnum+1] = clientcmd;
|
||||||
argnum += 2;
|
argnum += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_ANDROID_SetScreenKeyboardShown(1);
|
SDL_ANDROID_SetScreenKeyboardShown( 1 );
|
||||||
|
|
||||||
if( screenButtons && !SDL_ANDROID_GetScreenKeyboardRedefinedByUser() )
|
if( screenButtons && !SDL_ANDROID_GetScreenKeyboardRedefinedByUser() )
|
||||||
{
|
{
|
||||||
@@ -193,7 +193,9 @@ int main( int argc, char* argv[] )
|
|||||||
__android_log_print(ANDROID_LOG_INFO, "XSDL", "> %s", args[i]);
|
__android_log_print(ANDROID_LOG_INFO, "XSDL", "> %s", args[i]);
|
||||||
|
|
||||||
// We should never quit. If that happens, then the server did not start - show error.
|
// We should never quit. If that happens, then the server did not start - show error.
|
||||||
atexit(&showError);
|
atexit( &showError );
|
||||||
|
__android_log_print(ANDROID_LOG_INFO, "XSDL", "XSDL chdir to: %s", getenv("SECURE_STORAGE_DIR"));
|
||||||
|
chdir( getenv("SECURE_STORAGE_DIR") ); // Megahack: change /proc/self/cwd to the X.org data dir, and use /proc/self/cwd path in libX11
|
||||||
return android_main( argnum, args, envp );
|
return android_main( argnum, args, envp );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Submodule project/jni/application/xserver/xserver updated: 58c205cd11...4524f07e09
Submodule project/jni/boost/src updated: 5824acb451...bc9ea9d303
Submodule project/jni/shmem updated: c2a28f528d...89c7cb8d03
Reference in New Issue
Block a user