diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2018-07-27 09:24:50 +0900 |
---|---|---|
committer | Hwankyu Jhun <h.jhun@samsung.com> | 2018-07-27 09:24:50 +0900 |
commit | cff82a4b0f08a2444bcc3c3718ab09febba49ab6 (patch) | |
tree | 6017c9fa5dcf7f3805308b80448841a84ac0c2c6 /src | |
parent | 063bcbd579662fd9b077ebe023a9003945ca43f4 (diff) | |
download | app-core-cff82a4b0f08a2444bcc3c3718ab09febba49ab6.tar.gz app-core-cff82a4b0f08a2444bcc3c3718ab09febba49ab6.tar.bz2 app-core-cff82a4b0f08a2444bcc3c3718ab09febba49ab6.zip |
Modified window visibility check
After this patch is applied, the visibility is managed
in three ways. (NONE, FULLY OBSCUSRED and UNOBSCURED)
Change-Id: I5896c7d8e3fb6f0aed5c725c752ce294615b8a29
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ui_base/appcore_ui_base.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/ui_base/appcore_ui_base.c b/src/ui_base/appcore_ui_base.c index 8b83a1a..b7571c1 100644 --- a/src/ui_base/appcore_ui_base.c +++ b/src/ui_base/appcore_ui_base.c @@ -61,6 +61,12 @@ enum win_status { WS_RESUME, }; +enum visibility_type { + VT_NONE, + VT_UNOBSCURED, + VT_FULLY_OBSCURED, +}; + typedef struct _appcore_ui_base_context { appcore_ui_base_ops ops; void *data; @@ -87,7 +93,7 @@ static bool first_launch = true; struct win_node { unsigned int win; unsigned int surf; - bool bfobscured; + int vis; }; static GSList *g_winnode_list; @@ -380,7 +386,7 @@ static bool __add_win(unsigned int win, unsigned int surf) t->win = win; t->surf = surf; - t->bfobscured = FALSE; + t->vis = VT_NONE; g_winnode_list = g_slist_append(g_winnode_list, t); @@ -405,13 +411,13 @@ static bool __delete_win(unsigned int win) return TRUE; } -static bool __update_win(unsigned int win, unsigned int surf, bool bfobscured) +static bool __update_win(unsigned int win, unsigned int surf, int vis) { GSList *f; struct win_node *t; - _DBG("[EVENT_TEST][EVENT] __update_win WIN:%x fully_obscured %d\n", win, - bfobscured); + _DBG("[EVENT_TEST][EVENT] __update_win WIN:%x visibility %d\n", + win, vis); f = __find_win(win); if (!f) { @@ -424,7 +430,8 @@ static bool __update_win(unsigned int win, unsigned int surf, bool bfobscured) t->win = win; if (surf != 0) t->surf = surf; - t->bfobscured = bfobscured; + if (vis != VT_NONE) + t->vis = vis; return TRUE; } @@ -807,12 +814,15 @@ EXPORT_API void appcore_ui_base_window_on_show(int type, void *event) return; } - _DBG("[EVENT_TEST][EVENT] GET SHOW EVENT!!!. WIN:%x, %d\n", ev->win, ev->data[0]); + _DBG("[EVENT_TEST][EVENT] GET SHOW EVENT!!!. WIN:%x, %d\n", + ev->win, ev->data[0]); - if (!__find_win((unsigned int)ev->win)) + if (!__find_win((unsigned int)ev->win)) { __add_win((unsigned int)ev->win, (unsigned int)ev->data[0]); - else - __update_win((unsigned int)ev->win, (unsigned int)ev->data[0], FALSE); + } else { + __update_win((unsigned int)ev->win, (unsigned int)ev->data[0], + VT_NONE); + } if (ev->data[0] != 0) __group_attach(); @@ -827,8 +837,8 @@ static bool __check_visible(void) for (iter = g_winnode_list; iter != NULL; iter = g_slist_next(iter)) { entry = iter->data; - _DBG("win : %x obscured : %d\n", entry->win, entry->bfobscured); - if (entry->bfobscured == FALSE) + _DBG("win : %x visibility : %d\n", entry->win, entry->vis); + if (entry->vis == VT_UNOBSCURED) return true; } @@ -871,7 +881,8 @@ EXPORT_API void appcore_ui_base_window_on_visibility(int type, void *event) int bvisibility; ev = event; - __update_win((unsigned int)ev->win, 0, ev->fully_obscured); + __update_win((unsigned int)ev->win, 0, + ev->fully_obscured ? VT_FULLY_OBSCURED : VT_UNOBSCURED); bvisibility = __check_visible(); _DBG("bvisibility %d, w_status %d", bvisibility, w_status); @@ -903,7 +914,7 @@ EXPORT_API void appcore_ui_base_window_on_pre_visibility(int type, void *event) bool bvisibility; if (ev && ev->type == ECORE_WL2_WINDOW_VISIBILITY_TYPE_PRE_UNOBSCURED) { - __update_win((unsigned int)ev->win, 0, false); + __update_win((unsigned int)ev->win, 0, VT_UNOBSCURED); bvisibility = __check_visible(); _DBG("bvisibility %d, w_status %d", bvisibility, w_status); |