raster pushed a commit to branch master.

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

commit 690ab94c06e46d0fbf52054475800d2b74dc80d0
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Apr 15 18:04:49 2020 +0100

    focus - fix emacs buffer switch focus set reported by felipe
    
    emacs window (not in terminal). now in one:
    ctrl+x 5 2 <- open new buffer
    
    now we have it try switch to the other buffer:
    ctrl+x 5 o
    
    broken ... now fixed.
    
    @fix
---
 src/bin/e_comp_x.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index f6b93792f..a4858e5bc 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -3129,7 +3129,16 @@ _e_comp_x_focus_in(void *data EINA_UNUSED, int type 
EINA_UNUSED, Ecore_X_Event_W
 
    /* should be equal, maybe some clients don't reply with the proper 
timestamp ? */
    if (ev->time >= focus_time)
-     evas_object_focus_set(ec->frame, 1);
+     {
+        if (!evas_object_focus_get(ec->frame))
+          {
+             evas_object_focus_set(ec->frame, 1);
+             if (!e_client_focus_policy_click(ec))
+               e_client_pointer_warp_to_center_now(ec);
+          }
+        else
+          evas_object_focus_set(ec->frame, 1);
+     }
    /* handle case of someone trying to benchmark focus handling */
    if ((!e_client_focus_policy_click(ec)) && (focused && 
(!e_client_focus_policy_click(focused))) &&
        (ev->time - focus_time <= 2))
@@ -4901,8 +4910,8 @@ _e_comp_x_hook_client_focus_set(void *d EINA_UNUSED, 
E_Client *ec)
      }
    if (ec->override) return;
    focus_job_client = ec;
-   if (!focus_job)
-     focus_job = ecore_job_add(_e_comp_x_hook_client_focus_set_job, NULL);
+   if (focus_job) ecore_job_del(focus_job);
+   focus_job = ecore_job_add(_e_comp_x_hook_client_focus_set_job, NULL);
 }
 
 static void

-- 


Reply via email to