changeset 4832:2d42cddb1e09

[RT-32481] call to setEnabled(false) causes FOCUS_DIABLED event to be sent 1) move window->isEnabled = false; to the end of the request processing 2)send MouseEvent.EXIT only when mouse is actually above the window tested on BB
author Assaf Yavani
date Tue, 27 Aug 2013 13:58:42 +0300
parents 0a2b318d5698
children ec7f003e2214
files modules/graphics/src/main/native-glass/lens/LensApplication.c modules/graphics/src/main/native-glass/lens/LensWindow.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-glass/lens/LensApplication.c	Tue Aug 27 13:58:42 2013 +0300
+++ b/modules/graphics/src/main/native-glass/lens/LensApplication.c	Tue Aug 27 13:58:42 2013 +0300
@@ -450,8 +450,10 @@
         }
 
     } else {
-        GLASS_LOG_FINE("Window %d[%p] is disabled - sending FOCUS_DISABLED event",
-                       window->id, window);
+        GLASS_LOG_FINE("Window %d[%p] is disabled, can't send event %d - "
+                       "sending FOCUS_DISABLED event",
+                       window->id, window, eventType);
+
         glass_application_notifyWindowEvent(env,
                                             window,
                                             com_sun_glass_events_WindowEvent_FOCUS_DISABLED);
--- a/modules/graphics/src/main/native-glass/lens/LensWindow.c	Tue Aug 27 13:58:42 2013 +0300
+++ b/modules/graphics/src/main/native-glass/lens/LensWindow.c	Tue Aug 27 13:58:42 2013 +0300
@@ -562,13 +562,11 @@
                        enabled?"true":"false",
                        window->id, window);
 
-        window->isEnabled = enabled;
-
         GLASS_LOG_FINE("glass_window_setFocusable(%s)", enabled?"true":"false");
         glass_window_setFocusable(env, window, enabled);
 
         //syntheticlly notify view for mouse exit
-        if (!enabled && window->view) {
+        if (!enabled && window->view && window == lens_wm_getMouseWindow()) {
             glass_application_notifyMouseEvent(env,
                                                window,
                                                com_sun_glass_events_MouseEvent_EXIT, 
@@ -576,6 +574,8 @@
                                                com_sun_glass_events_MouseEvent_BUTTON_NONE);
 
         }
+
+        window->isEnabled = enabled;
     }
 }