Bug 1182665 - Use a direct JNI call to determine screen size in nsScreenManagerAndroid r=jchen
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user