From ce24db1f5f1749e8b92e50c6f5b6ccfb9dd0b6d7 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Thu, 7 Feb 2019 19:22:02 +0900 Subject: [PATCH] e_hwc_windows: sort the hwc_windows by zpos Change-Id: I29ce6c46f69a1ee2fffdc782e5d84ac8a95109ff --- src/bin/e_hwc_windows.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index b3e2fd3b5c..3288016f3e 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -2358,6 +2358,18 @@ e_hwc_windows_dump_stop(void) ehws_dump_enable = EINA_FALSE; } +static int +_e_hwc_windows_window_debug_cb_sort(const void *d1, const void *d2) +{ + E_Hwc_Window *hwc_window1 = (E_Hwc_Window *)d1; + E_Hwc_Window *hwc_window2 = (E_Hwc_Window *)d2; + + if (!hwc_window1) return(1); + if (!hwc_window2) return(-1); + + return (hwc_window2->zpos - hwc_window1->zpos); +} + static void _e_hwc_windows_window_debug_info_get(Eldbus_Message_Iter *iter, E_Hwc_Wins_Debug_Cmd cmd) { @@ -2403,6 +2415,8 @@ _e_hwc_windows_window_debug_info_get(Eldbus_Message_Iter *iter, E_Hwc_Wins_Debug hwc = output->hwc; if (!output->hwc) continue; + hwc->hwc_windows = eina_list_sort(hwc->hwc_windows, eina_list_count(hwc->hwc_windows), _e_hwc_windows_window_debug_cb_sort); + EINA_LIST_FOREACH(hwc->hwc_windows, l2, hwc_window) { if (!hwc_window) continue; -- 2.34.1