discomfitor pushed a commit to branch enlightenment-0.19.

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

commit c34e693614c48290d5a1c7d1c3721448493c75ec
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Sep 21 18:19:03 2015 -0400

    only set focus on clients which are visible during client eval
    
    focusing a client will automatically uniconify and desk flip, so
    setting focus on a hidden client should be avoided during eval since
    these focus-sets are not "user triggered"
    
    this fixes issues where clients could randomly grab focus from other
    desks and also restores expected behavior when restarting e on an
    empty vdesk
---
 src/bin/e_client.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 7f49738..8670118 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -2204,14 +2204,12 @@ _e_client_eval(E_Client *ec)
                  ec->changes.need_maximize || ec->changes.need_unmaximize;
    ec->changes.stack = 0;
 
-   if ((!ec->input_only) && ((ec->take_focus) || (ec->want_focus)))
+   if ((!ec->input_only) && (!ec->iconic) &&
+       ((!ec->zone) || e_client_util_desk_visible(ec, 
e_desk_current_get(ec->zone))) &&
+       ((ec->take_focus) || (ec->want_focus)))
      {
-        ec->take_focus = 0;
         if ((e_config->focus_setting == E_FOCUS_NEW_WINDOW) || 
(ec->want_focus))
-          {
-             ec->want_focus = 0;
-             e_client_focus_set_with_pointer(ec);
-          }
+          e_client_focus_set_with_pointer(ec);
         else if (ec->dialog)
           {
              if ((e_config->focus_setting == E_FOCUS_NEW_DIALOG) ||
@@ -2240,6 +2238,8 @@ _e_client_eval(E_Client *ec)
                }
           }
      }
+   else
+     ec->take_focus = ec->want_focus = 0;
 
    if (ec->changes.need_maximize)
      {

-- 


Reply via email to