discomfitor pushed a commit to branch master.

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

commit 4a33cd7ba0c51b911b1d7845411d2b70e01a3d55
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 b0dfc7d..669712d 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -2203,14 +2203,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) ||
@@ -2239,6 +2237,8 @@ _e_client_eval(E_Client *ec)
                }
           }
      }
+   else
+     ec->take_focus = ec->want_focus = 0;
 
    if (ec->changes.need_maximize)
      {

-- 


Reply via email to