diff --git a/project/jni/application/xserver/AndroidBuild.sh b/project/jni/application/xserver/AndroidBuild.sh index dd6ccd9eb..d1c04c414 100755 --- a/project/jni/application/xserver/AndroidBuild.sh +++ b/project/jni/application/xserver/AndroidBuild.sh @@ -79,7 +79,7 @@ mkdir -p $CURDIR/tmp-$1 cd $CURDIR/tmp-$1 cp -f $CURDIR/xserver/data/busybox-$1 ./busybox mkdir -p usr/bin -for f in xhost xkbcomp xli xsel; do cp -f $CURDIR/xserver/android/$1/$f ./usr/bin/$f ; done +for f in xhost xkbcomp xloadimage xsel; do cp -f $CURDIR/xserver/android/$1/$f ./usr/bin/$f ; done # Statically-linked prebuilt executables, generated using Debian chroot. if false; then # Disable PulseAudio for now diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index d6a30e18c..edfc31410 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -394,12 +394,13 @@ void XSDL_unpackFiles(int _freeSpaceRequiredMb) SDL_JoystickClose(j0); } -void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH, int * builtinKeyboard, int * ctrlAltShiftKeys) +void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH, int * builtinKeyboard, int * ctrlAltShiftKeys, char * portStr) { int x = 0, y = 0, i, ii; SDL_Event event; int res = -1, dpi = -1; int customX = 1000, customY = 1000; + int port = atoi(portStr + 1); enum { MODE_CUSTOM = 11 }; char native[32] = "0x0", native56[32], native46[32], native36[32], native26[32]; char custom[32] = "1000x1000"; @@ -460,10 +461,11 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i cfgfile = fopen(cfgpath, "r"); if( cfgfile ) { - fscanf(cfgfile, "%d %d %d %d %d %d", &savedRes, &savedDpi, &customX, &customY, builtinKeyboard, ctrlAltShiftKeys); + fscanf(cfgfile, "%d %d %d %d %d %d %d", &savedRes, &savedDpi, &customX, &customY, builtinKeyboard, ctrlAltShiftKeys, &port); fclose(cfgfile); } sprintf(custom, "%dx%d", customX, customY); + sprintf(portStr, ":%d", port); int counter = 3000, config = 0; Uint32 curtime = SDL_GetTicks(); @@ -497,6 +499,9 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i y += 30; sprintf(buf, "Keyboard: %s", *builtinKeyboard == 0 ? "System" : *builtinKeyboard == 1 ? "Builtin QWERTY" : "System + Builtin"); renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y); + y += 30; + sprintf(buf, "Display number: %d", port); + renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y); y += 40; sprintf(buf, "Starting in %d seconds", counter / 1000 + 1); renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y); @@ -692,10 +697,15 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i x = y; y = z; } - if( y > 0 && y < VID_Y * 2 / 6 ) + if( y > 0 && y < VID_Y * 1.5f / 6 ) *builtinKeyboard = (*builtinKeyboard + 1) % 3; - if( y > VID_Y * 2 / 6 && y < VID_Y * 4 / 6 ) + if( y > VID_Y * 1.5f / 6 && y < VID_Y * 2.5f / 6 ) *ctrlAltShiftKeys = !*ctrlAltShiftKeys; + if( y > VID_Y * 2.5f / 6 && y < VID_Y * 3.5f / 6 ) + { + port ++; + port %= 4; + } if( y > VID_Y * 4 / 6 && y < VID_Y * 6 / 6 ) okay = 1; __android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d dpi %d\n", x, y, res); @@ -715,6 +725,9 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i renderString(buf, VID_X/2, VID_Y * 1 / 6); sprintf(buf, "Separate Ctrl/Alt/Shift keys: %s", *ctrlAltShiftKeys == 0 ? "No" : "Yes"); + renderString(buf, VID_X/2, VID_Y * 2 / 6); + + sprintf(buf, "Display number: %d", port); renderString(buf, VID_X/2, VID_Y * 3 / 6); sprintf(buf, "Okay"); @@ -731,10 +744,11 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i cfgfile = fopen(cfgpath, "w"); if( cfgfile ) { - fprintf(cfgfile, "%d %d %d %d %d %d\n", res, dpi, customX, customY, *builtinKeyboard, *ctrlAltShiftKeys); + fprintf(cfgfile, "%d %d %d %d %d %d %d\n", res, dpi, customX, customY, *builtinKeyboard, *ctrlAltShiftKeys, port); fclose(cfgfile); } } + sprintf(portStr, ":%d", port); } void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, int resolutionH) diff --git a/project/jni/application/xserver/gfx.h b/project/jni/application/xserver/gfx.h index 9fc48723a..41e46e882 100644 --- a/project/jni/application/xserver/gfx.h +++ b/project/jni/application/xserver/gfx.h @@ -6,7 +6,7 @@ enum { VID_X = 480, VID_Y = 320 }; void XSDL_initSDL(); void XSDL_deinitSDL(); void XSDL_unpackFiles(int freeSpaceRequiredMb); -void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH, int * builtinKeyboard, int * ctrlAltShiftKeys); +void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH, int * builtinKeyboard, int * ctrlAltShiftKeys, char * port); void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, int resolutionH); void XSDL_showServerLaunchErrorMessage(); diff --git a/project/jni/application/xserver/main.c b/project/jni/application/xserver/main.c index 8ef64df82..8e6c56757 100644 --- a/project/jni/application/xserver/main.c +++ b/project/jni/application/xserver/main.c @@ -119,17 +119,17 @@ int main( int argc, char* argv[] ) if( !screenResOverride ) { - XSDL_showConfigMenu(&resolutionW, &displayW, &resolutionH, &displayH, &builtinKeyboard, &screenButtons); + XSDL_showConfigMenu(&resolutionW, &displayW, &resolutionH, &displayH, &builtinKeyboard, &screenButtons, port); sprintf( screenres, "%d/%dx%d/%dx%d", resolutionW, displayW, resolutionH, displayH, SDL_GetVideoInfo()->vfmt->BitsPerPixel ); } - XSDL_generateBackground( port, printHelp, resolutionW, resolutionH ); + XSDL_generateBackground( port, printHelp, 800, 600 ); XSDL_deinitSDL(); if( printHelp ) { - sprintf( clientcmd, "%s/usr/bin/xhost + ; %s/usr/bin/xli -onroot -center %s/background.bmp", + sprintf( clientcmd, "%s/usr/bin/xhost + ; %s/usr/bin/xloadimage -onroot -fullscreen %s/background.bmp", getenv("SECURE_STORAGE_DIR"), getenv("SECURE_STORAGE_DIR"), getenv("UNSECURE_STORAGE_DIR") ); args[argnum] = "-exec"; args[argnum+1] = clientcmd; diff --git a/project/jni/application/xserver/xserver b/project/jni/application/xserver/xserver index adeeb0ea7..fb10fe8d7 160000 --- a/project/jni/application/xserver/xserver +++ b/project/jni/application/xserver/xserver @@ -1 +1 @@ -Subproject commit adeeb0ea782c752afa79dbd4b2aa86c8cdd464ed +Subproject commit fb10fe8d77f55f74874d94c0bb7903f378d9f0f6