Bug 1182665 - Use a direct JNI call to determine screen size in nsScreenManagerAndroid r=jchen

This commit is contained in:
James Willcox
2015-08-26 15:25:40 -05:00
parent cf77dff828
commit 751e8882c2
7 changed files with 46 additions and 8 deletions

View File

@@ -8,6 +8,9 @@
#include "nsScreenManagerAndroid.h"
#include "nsWindow.h"
#include "AndroidBridge.h"
#include "GeneratedJNIWrappers.h"
#include "AndroidRect.h"
#include <mozilla/jni/Refs.h>
using namespace mozilla;
@@ -29,13 +32,11 @@ nsScreenAndroid::GetId(uint32_t *outId)
NS_IMETHODIMP
nsScreenAndroid::GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight)
{
gfx::IntSize sz = nsWindow::GetAndroidScreenBounds();
*outLeft = 0;
*outTop = 0;
*outWidth = sz.width;
*outHeight = sz.height;
widget::sdk::Rect::LocalRef rect = widget::GeckoAppShell::GetScreenSize();
rect->Left(outLeft);
rect->Top(outTop);
rect->Width(outWidth);
rect->Height(outHeight);
return NS_OK;
}