From 77f9aa3f446c2fd0d07d5163dd30a2f3f37e1442 Mon Sep 17 00:00:00 2001 From: Unsung Lee Date: Mon, 31 Jul 2023 15:04:58 +0900 Subject: [PATCH] proc-monitor: Identify windows to save in app info 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 --- src/process/proc-monitor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/process/proc-monitor.c b/src/process/proc-monitor.c index 222397d..0948090 100644 --- a/src/process/proc-monitor.c +++ b/src/process/proc-monitor.c @@ -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)); -- 2.7.4