proc-monitor: Identify windows to save in app info 60/296560/1
authorUnsung Lee <unsung.lee@samsung.com>
Mon, 31 Jul 2023 06:04:58 +0000 (15:04 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Tue, 1 Aug 2023 05:29:43 +0000 (14:29 +0900)
A process can have more than one window, so identify
a window to save in an app info.
Currently, if a process already registered a window
and other window of this process is not focused,
then resourced ignores window update.

Change-Id: I50890744ee93dd8da4fd996a3eea7880a7efd9ee
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/process/proc-monitor.c

index 222397d..0948090 100644 (file)
@@ -162,11 +162,8 @@ static int insert_window_in_window_table(GHashTable *window_table,
         * If one of window has is_focused = 1, then it is the most important.
         * Otherwise, the higher in the window stack, the more important window.
         */
-       if (!window->is_focused)
-               return RESOURCED_ERROR_NONE;
-
        existing_window = g_hash_table_lookup(window_table, (gconstpointer) &window->pid);
-       if (existing_window)
+       if (existing_window && !window->is_focused)
                return RESOURCED_ERROR_NONE;
 
        new_window = calloc(1, sizeof(struct proc_app_window_info));