Messing around code at random to fix immersive mode, broken for Lenovo Yoga tablet with Android 4.4.2
This commit is contained in:
@@ -297,23 +297,34 @@ public class MainActivity extends Activity
|
||||
}
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
}
|
||||
// Hackish way to set immersive mode, it seems to need some delay before we can create surfaces
|
||||
runOnUiThread(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
initSDLVideoLayout();
|
||||
}
|
||||
});
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch( Exception ee ) {}
|
||||
runOnUiThread(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
}
|
||||
});
|
||||
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT && Globals.ImmersiveMode )
|
||||
{
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch( Exception eee ) {}
|
||||
}
|
||||
runOnUiThread(new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
// Hide navigation buttons, and sleep a bit so OS will process the event.
|
||||
// Do not check the display size in a loop - we may have several displays of different sizes,
|
||||
// so app may stuck in infinite loop
|
||||
DisplayMetrics dm = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||
if( android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT && Globals.ImmersiveMode &&
|
||||
(_videoLayout.getHeight() != dm.widthPixels || _videoLayout.getWidth() != dm.heightPixels) )
|
||||
{
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
try {
|
||||
Thread.sleep(300);
|
||||
} catch( Exception e ) {}
|
||||
}
|
||||
initSDLInternal();
|
||||
}
|
||||
});
|
||||
@@ -321,13 +332,10 @@ public class MainActivity extends Activity
|
||||
})).start();
|
||||
}
|
||||
|
||||
private void initSDLInternal()
|
||||
private void initSDLVideoLayout()
|
||||
{
|
||||
if(sdlInited)
|
||||
return;
|
||||
Log.i("SDL", "libSDL: Initializing video and SDL application");
|
||||
|
||||
sdlInited = true;
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
_videoLayout.removeView(_layout);
|
||||
if( _ad.getView() != null )
|
||||
@@ -340,6 +348,15 @@ public class MainActivity extends Activity
|
||||
_videoLayout = new FrameLayout(this);
|
||||
SetLayerType.get().setLayerType(_videoLayout);
|
||||
setContentView(_videoLayout);
|
||||
DimSystemStatusBar.get().dim(_videoLayout);
|
||||
}
|
||||
private void initSDLInternal()
|
||||
{
|
||||
if(sdlInited)
|
||||
return;
|
||||
Log.i("SDL", "libSDL: Initializing video and SDL application");
|
||||
|
||||
sdlInited = true;
|
||||
mGLView = new DemoGLSurfaceView(this);
|
||||
SetLayerType.get().setLayerType(mGLView);
|
||||
_videoLayout.addView(mGLView);
|
||||
|
||||
Submodule project/jni/application/hid-pc-keyboard/src updated: ee98efcb34...3f8b7f839d
@@ -7,10 +7,10 @@ AppName="XServer XSDL"
|
||||
AppFullName=x.org.server
|
||||
|
||||
# Application version code (integer)
|
||||
AppVersionCode=11123
|
||||
AppVersionCode=11124
|
||||
|
||||
# Application user-visible version name (string)
|
||||
AppVersionName="1.11.23"
|
||||
AppVersionName="1.11.24"
|
||||
|
||||
# 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
|
||||
|
||||
Reference in New Issue
Block a user