proc-monitor: Identify windows to save in app info
[platform/core/system/resourced.git] / 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));