Revision: 2511
http://sourceforge.net/p/swingme/code/2511
Author: yuranet
Date: 2021-07-06 07:48:43 +0000 (Tue, 06 Jul 2021)
Log Message:
-----------
fix to default to no focus on ios
Modified Paths:
--------------
SwingME/src/net/yura/mobile/gui/DesktopPane.java
SwingME/src/net/yura/mobile/gui/components/Window.java
Modified: SwingME/src/net/yura/mobile/gui/DesktopPane.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/DesktopPane.java 2021-07-06 00:13:25 UTC (rev 2510)
+++ SwingME/src/net/yura/mobile/gui/DesktopPane.java 2021-07-06 07:48:43 UTC (rev 2511)
@@ -143,6 +143,7 @@
public boolean HIDDEN_MENU; // on old android and blackberry the menu and back are hardware buttons
public boolean HIDDEN_BACK;
public boolean GRID_MENU; // on old android
+ public boolean DEFAULT_NO_FOCUS;
// object variables
protected Midlet midlet;
@@ -199,6 +200,7 @@
VERY_BIG_SCREEN = platform == Midlet.PLATFORM_ME4SE;
MAX_CLOSE_BUTTONS = platform == Midlet.PLATFORM_ME4SE;
IPHONE_SCROLL = platform != Midlet.PLATFORM_ME4SE;
+ DEFAULT_NO_FOCUS = platform == Midlet.PLATFORM_ANDROID || platform == Midlet.PLATFORM_IOS;
QWERTY_KAYPAD = platform == Midlet.PLATFORM_ME4SE || platform == Midlet.PLATFORM_ANDROID || platform == Midlet.PLATFORM_IOS || (platform == Midlet.PLATFORM_BLACKBERRY && !KeyEvent.BLACKBERRY_ITUT);
Modified: SwingME/src/net/yura/mobile/gui/components/Window.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Window.java 2021-07-06 00:13:25 UTC (rev 2510)
+++ SwingME/src/net/yura/mobile/gui/components/Window.java 2021-07-06 07:48:43 UTC (rev 2511)
@@ -92,7 +92,7 @@
// on android this call can return null even if there are components to focus
// as on android no components are focused by defualt
- if (Midlet.getPlatform()!=Midlet.PLATFORM_ANDROID) {
+ if (!DesktopPane.getDesktopPane().DEFAULT_NO_FOCUS) {
breakOutAction(null,Canvas.DOWN,false,false);
}
}
@@ -105,7 +105,7 @@
* @see java.awt.KeyboardFocusManager#clearGlobalFocusOwner() KeyboardFocusManager.clearGlobalFocusOwner
*/
public void setNothingFocused() {
- if (Midlet.getPlatform()==Midlet.PLATFORM_ANDROID) {
+ if (DesktopPane.getDesktopPane().DEFAULT_NO_FOCUS) {
// we have to use mostRecentFocusOwner here as the window may have lost focus by now
// as the button could have opened a new window, and focusOwner could be returning null
Component f = getMostRecentFocusOwner();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|