From e78147dd06d154c487c8f68eee0c928aa6856599 Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 28 Feb 2012 22:18:28 +0000 Subject: [PATCH] Android: screen size fix. --- .../juce_gui_basics/native/juce_android_Windowing.cpp | 10 +++++++++- modules/juce_gui_basics/windows/juce_ComponentPeer.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_android_Windowing.cpp b/modules/juce_gui_basics/native/juce_android_Windowing.cpp index eaa818287d..36e257870a 100644 --- a/modules/juce_gui_basics/native/juce_android_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_android_Windowing.cpp @@ -231,6 +231,14 @@ public: view.callIntMethod (ComponentPeerView.getHeight)); } + void handleScreenSizeChange() + { + ComponentPeer::handleScreenSizeChange(); + + if (isFullScreen()) + setFullScreen (true); + } + Point getScreenPosition() const { return Point (view.callIntMethod (ComponentPeerView.getLeft), @@ -706,7 +714,7 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis //============================================================================== void Desktop::getCurrentMonitorPositions (Array >& monitorCoords, const bool clipToWorkArea) { - monitorCoords.add (Rectangle (0, 0, android.screenWidth, android.screenHeight)); + monitorCoords.add (Rectangle (android.screenWidth, android.screenHeight)); } JUCE_JNI_CALLBACK (JUCE_ANDROID_ACTIVITY_CLASSNAME, setScreenSize, void, (JNIEnv* env, jobject activity, diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.h b/modules/juce_gui_basics/windows/juce_ComponentPeer.h index 351134d773..ab3d15ae5a 100644 --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.h +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.h @@ -224,7 +224,7 @@ public: A peer implementation must call this if the monitor arrangement changes or the available screen size changes. */ - void handleScreenSizeChange(); + virtual void handleScreenSizeChange(); //============================================================================== /** This is called to repaint the component into the given context. */