changeset 4831:0a2b318d5698

[RT-32478] incorect focus handling in some window's visibility state 1)grant the focus to a window when it become visible - changed from only to windows to windows that are focusable and enabled 2)deny focus request on invisible windows Tested on device
author Assaf Yavani
date Tue, 27 Aug 2013 13:58:42 +0300
parents 922bb2496c20
children 2d42cddb1e09
files modules/graphics/src/main/native-glass/lens/wm/LensWindowManager.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-glass/lens/wm/LensWindowManager.c	Tue Aug 27 13:58:42 2013 +0300
+++ b/modules/graphics/src/main/native-glass/lens/wm/LensWindowManager.c	Tue Aug 27 13:58:42 2013 +0300
@@ -547,8 +547,8 @@
         //lose focus and grab
         lens_wm_unsetFocusedWindow(env, window);        
     } else {
-        if (!window->owner) {
-            //window become visible, grant it the focus if not a pop-up
+        if (window->isFocusable && window->isEnabled) {
+            //window become visible, grant it the focus
             lens_wm_setFocusedWindow(env, window);
         }
     }
@@ -590,12 +590,17 @@
     }
 
     if (!window->isFocusable) {
-        GLASS_LOG_WARNING("Focus requested on isFocusable=false");
+        GLASS_LOG_WARNING("Focus requested on isFocusable=false - ignore");
         return JNI_FALSE;
     }
 
     if (!window->isEnabled) {
-        GLASS_LOG_WARNING("Focus requested on isEnabled=false");
+        GLASS_LOG_WARNING("Focus requested on isEnabled=false - ignore");
+        return JNI_FALSE;
+    }
+
+    if (!window->isVisible) {
+        GLASS_LOG_WARNING("Focus requested on isVisible=false - ignore");
         return JNI_FALSE;
     }