e_process: check internal window while handling activate/deactivate process 96/288196/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 13 Feb 2023 11:15:46 +0000 (20:15 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 13 Feb 2023 11:29:35 +0000 (20:29 +0900)
There was a bug that the status of process didn't change to DEACTIVATE when the internal ec got
focused.

For resolve this problem, we check the focus ec is internal ec or not. If focus ec is internal,
then e changes the previous activate process' state to DEACTIVATE.

Change-Id: I62961438c61cfc0685c595e93c9406c41eed963b

src/bin/e_process.c

index e4d3d85..c1b8258 100644 (file)
@@ -336,7 +336,15 @@ _e_process_cb_client_focus_in(void *data EINA_UNUSED, int type EINA_UNUSED, void
    if (!ec) return ECORE_CALLBACK_PASS_ON;
 
    pid = ec->netwm.pid;
-   if (pid <= 0) return ECORE_CALLBACK_PASS_ON;
+   if (pid <= 0)
+     {
+        if (ec->internal)
+          {
+             ELOGF("PROCESS", "FOCUS is set to internal window. Check deactivate process", ec);
+             goto check_deactivate;
+          }
+        return ECORE_CALLBACK_PASS_ON;
+     }
 
    pinfo = _e_process_find(_e_process_manager, pid);
    if (!pinfo)
@@ -380,6 +388,22 @@ _e_process_cb_client_focus_in(void *data EINA_UNUSED, int type EINA_UNUSED, void
      }
 
    return ECORE_CALLBACK_PASS_ON;
+
+check_deactivate:
+   ec_deactive = _e_process_manager->active_win;
+   _e_process_manager->active_win = ec;
+
+   if (ec_deactive)
+     {
+        pinfo_deactive = _e_process_find(_e_process_manager, ec_deactive->netwm.pid);
+        if (pinfo_deactive)
+          {
+             ELOGF("PROCESS", "ACTION DEACTIVATE (just). PID:%d", NULL, pinfo_deactive->pid);
+             _e_process_action_change(pinfo_deactive, E_PROCESS_ACT_DEACTIVATE);
+          }
+     }
+
+   return ECORE_CALLBACK_PASS_ON;
 }
 
 static void