зеркало из https://github.com/mozilla/gecko-dev.git
bug 601282 - Sometimes fennec's window is black when started the DEBUG intent r=mwu a=blocking-fennec
This commit is contained in:
Родитель
c4214860e8
Коммит
aa0b369a7d
|
@ -70,6 +70,7 @@ class GeckoAppShell
|
|||
private GeckoAppShell() { }
|
||||
|
||||
static boolean sGeckoRunning;
|
||||
static private GeckoEvent gPendingResize = null;
|
||||
|
||||
static private boolean gRestartScheduled = false;
|
||||
|
||||
|
@ -90,7 +91,6 @@ class GeckoAppShell
|
|||
public static native void nativeRun(String args);
|
||||
|
||||
// helper methods
|
||||
public static native void setInitialSize(int width, int height);
|
||||
public static native void setSurfaceView(GeckoSurfaceView sv);
|
||||
public static native void putenv(String map);
|
||||
public static native void onResume();
|
||||
|
@ -146,13 +146,25 @@ class GeckoAppShell
|
|||
combinedArgs += " " + url;
|
||||
// and go
|
||||
GeckoAppShell.nativeRun(combinedArgs);
|
||||
if (gPendingResize != null) {
|
||||
notifyGeckoOfEvent(gPendingResize);
|
||||
gPendingResize = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static GeckoEvent mLastDrawEvent;
|
||||
|
||||
public static void sendEventToGecko(GeckoEvent e) {
|
||||
if (sGeckoRunning)
|
||||
if (sGeckoRunning) {
|
||||
if (gPendingResize != null) {
|
||||
notifyGeckoOfEvent(gPendingResize);
|
||||
gPendingResize = null;
|
||||
}
|
||||
notifyGeckoOfEvent(e);
|
||||
} else {
|
||||
if (e.mType == GeckoEvent.SIZE_CHANGED)
|
||||
gPendingResize = e;
|
||||
}
|
||||
}
|
||||
|
||||
// Tell the Gecko event loop that an event is available.
|
||||
|
|
|
@ -116,9 +116,6 @@ class GeckoSurfaceView
|
|||
|
||||
Log.i("GeckoAppJava", "surfaceChanged: fmt: " + format + " dim: " + width + " " + height);
|
||||
|
||||
if (!GeckoAppShell.sGeckoRunning)
|
||||
return;
|
||||
|
||||
GeckoEvent e = new GeckoEvent(GeckoEvent.SIZE_CHANGED, width, height, -1, -1);
|
||||
GeckoAppShell.sendEventToGecko(e);
|
||||
|
||||
|
|
|
@ -217,7 +217,6 @@ SHELL_WRAPPER0(nativeInit)
|
|||
SHELL_WRAPPER1(nativeRun, jstring)
|
||||
SHELL_WRAPPER1(notifyGeckoOfEvent, jobject)
|
||||
SHELL_WRAPPER1(setSurfaceView, jobject)
|
||||
SHELL_WRAPPER2(setInitialSize, int, int)
|
||||
SHELL_WRAPPER0(onResume)
|
||||
SHELL_WRAPPER0(onLowMemory)
|
||||
SHELL_WRAPPER3(callObserver, jstring, jstring, jstring)
|
||||
|
@ -508,7 +507,6 @@ loadLibs(const char *apkName)
|
|||
GETFUNC(nativeRun);
|
||||
GETFUNC(notifyGeckoOfEvent);
|
||||
GETFUNC(setSurfaceView);
|
||||
GETFUNC(setInitialSize);
|
||||
GETFUNC(onResume);
|
||||
GETFUNC(onLowMemory);
|
||||
GETFUNC(callObserver);
|
||||
|
|
|
@ -58,7 +58,6 @@ extern "C" {
|
|||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_nativeInit(JNIEnv *, jclass);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyGeckoOfEvent(JNIEnv *, jclass, jobject event);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobject sv);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setInitialSize(JNIEnv *jenv, jclass, int width, int height);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *, jclass);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *, jclass);
|
||||
NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_callObserver(JNIEnv *, jclass, jstring observerKey, jstring topic, jstring data);
|
||||
|
@ -92,12 +91,6 @@ Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobjec
|
|||
AndroidBridge::Bridge()->SetSurfaceView(jenv->NewGlobalRef(obj));
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_setInitialSize(JNIEnv *jenv, jclass, int width, int height)
|
||||
{
|
||||
nsWindow::SetInitialAndroidBounds(gfxIntSize(width, height));
|
||||
}
|
||||
|
||||
NS_EXPORT void JNICALL
|
||||
Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *jenv, jclass jc)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче