Compare commits

..

No commits in common. "a3fa7df1f37adc71c6613696cfe7dedb74dfac71" and "098380ce068d68a129ac99d22b81ab316bb0421e" have entirely different histories.

2 changed files with 8 additions and 12 deletions

View File

@ -29,12 +29,13 @@ import {{.JavaPkg}}.ebitenmobileview.RenderRequester;
import {{.JavaPkg}}.{{.PrefixLower}}.EbitenView;
class EbitenSurfaceView extends GLSurfaceView implements RenderRequester {
// As GLSurfaceView can be recreated, the states must be static (#3097).
static private boolean errored_ = false;
static private boolean onceSurfaceCreated_ = false;
static private boolean contextLost_ = false;
private class EbitenRenderer implements GLSurfaceView.Renderer {
private boolean errored_ = false;
private boolean onceSurfaceCreated_ = false;
private boolean contextLost_ = false;
@Override
public void onDrawFrame(GL10 gl) {
if (errored_) {
@ -99,7 +100,7 @@ class EbitenSurfaceView extends GLSurfaceView implements RenderRequester {
}
private void onContextLost() {
Log.e("Go", "The application was killed due to context loss");
Log.v("Go", "Kill the application due to a context lost");
// TODO: Relaunch this application for better UX (#805).
Runtime.getRuntime().exit(0);
}

View File

@ -81,8 +81,6 @@ type userInterfaceImpl struct {
initWindowMaximized bool
initWindowMousePassthrough bool
initUnfocused bool
// bufferOnceSwapped must be accessed from the main thread.
bufferOnceSwapped bool
@ -1089,7 +1087,6 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
return err
}
u.initUnfocused = options.InitUnfocused
focused := glfw.True
if options.InitUnfocused {
focused = glfw.False
@ -1291,10 +1288,8 @@ func (u *UserInterface) update() (float64, float64, error) {
if err = u.window.Show(); err != nil {
return
}
if !u.initUnfocused {
if err = u.window.Focus(); err != nil {
return
}
if err = u.window.Focus(); err != nil {
return
}
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {