discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=81a797a0fa1dbe3c979c97351b714e4b5a8024ee

commit 81a797a0fa1dbe3c979c97351b714e4b5a8024ee
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri Jul 31 13:55:44 2015 -0400

    defer focus-setting on focus revert during desk flip when visibility is 
pending
    
    in the case that a client is going to be shown on the next loop iteration,
    focus setting must still occur and be deferred
    
    this fixes the case of a window appearing on a desk while the user is 
switching
    desks away from it even though this window is attempting to focus itself
---
 src/bin/e_desk.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c
index 6eba34f..900d655 100644
--- a/src/bin/e_desk.c
+++ b/src/bin/e_desk.c
@@ -371,7 +371,7 @@ e_desk_last_focused_focus(E_Desk *desk)
 
    EINA_LIST_FOREACH(e_client_focus_stack_get(), l, ec)
      {
-        if ((!ec->iconic) && (evas_object_visible_get(ec->frame)) &&
+        if ((!ec->iconic) && (evas_object_visible_get(ec->frame) || 
ec->changes.visible) &&
             ((ec->desk == desk) || ((ec->zone == desk->zone) && ec->sticky)) &&
             (ec->icccm.accepts_focus || ec->icccm.take_focus) &&
             (ec->netwm.type != E_WINDOW_TYPE_DOCK) &&
@@ -388,16 +388,22 @@ e_desk_last_focused_focus(E_Desk *desk)
                        ecs = ec;
                        continue;
                     }
-                  e_client_focus_set_with_pointer(ec);
+                  if (ec->changes.visible)
+                    ec->want_focus = ec->take_focus = 1;
+                  else
+                    e_client_focus_set_with_pointer(ec);
                   if (e_config->raise_on_revert_focus)
                     evas_object_raise(ec->frame);
                   return ec;
                }
           }
      }
-   if (ecs && evas_object_visible_get(ecs->frame))
+   if (ecs)
      {
-        e_client_focus_set_with_pointer(ecs);
+        if (ecs->changes.visible)
+          ecs->want_focus = ecs->take_focus = 1;
+        else
+          e_client_focus_set_with_pointer(ecs);
         if (e_config->raise_on_revert_focus)
           evas_object_raise(ecs->frame);
         return ecs;

-- 


Reply via email to