(void) client;
(void) key;
- Eina_Bool res = EINA_FALSE, below_focus = EINA_FALSE;
+ int delivery_mode = TIZEN_KEYROUTER_MODE_NONE;
+ Eina_Bool below_focus = EINA_FALSE;
E_Client *ec_top = NULL, *ec_focus = NULL;
struct wl_resource *surface = NULL, *surface_focus = NULL;
Eina_List* key_list = NULL, *l = NULL, *l_next = NULL;
int deliver_invisible = 0;
// Check for exclusive & or_exclusive mode delivery
- if (krt->HardKeys[key].excl_ptr || krt->HardKeys[key].or_excl_ptr)
+ if (krt->HardKeys[key].excl_ptr)
{
+ delivery_mode = TIZEN_KEYROUTER_MODE_EXCLUSIVE;
goto finish;
}
+ if (krt->HardKeys[key].or_excl_ptr)
+ {
+ delivery_mode = TIZEN_KEYROUTER_MODE_OVERRIDABLE_EXCLUSIVE;
+ goto finish;
+ }
ec_top = e_client_top_get();
ec_focus = e_client_focused_get();
for (; ec_top != NULL; ec_top = e_client_below_get(ec_top))
{
-
surface = e_keyrouter_util_get_surface_from_eclient(ec_top);
if (surface == NULL)
if (ec_top->is_cursor) continue;
+ //Check Top-Most Delivery
+ if( below_focus == EINA_FALSE)
+ {
+ EINA_LIST_FOREACH_SAFE(krt->HardKeys[key].top_ptr, l, l_next, key_node_data)
+ {
+ if (!key_node_data) continue;
+ if ((ec_top->visible) && (ec_top == wl_resource_get_user_data(key_node_data->surface)))
+ {
+ delivery_mode = TIZEN_KEYROUTER_MODE_TOPMOST;
+ goto finish;
+ }
+ }
+ }
+
// Check if window stack reaches to focus window
if (ec_top == ec_focus)
{
below_focus = EINA_TRUE;
}
- //Check Top-Most Delivery
- if( below_focus == EINA_FALSE)
- {
- EINA_LIST_FOREACH_SAFE(krt->HardKeys[key].top_ptr, l, l_next, key_node_data)
- {
- if (key_node_data)
- {
- if (ec_top == wl_resource_get_user_data(key_node_data->surface))
- {
- goto finish;
- }
- }
- }
- }
-
// Check for FORCE DELIVER to INVISIBLE WINDOW
if (deliver_invisible && IsInvisibleGetWindow(surface))
{
if(*key_data == key)
{
- res = EINA_TRUE;
+ delivery_mode = TIZEN_KEYROUTER_MODE_REGISTERED;
goto finish;
}
}
}
finish:
- tizen_keyrouter_send_keyregister_notify(resource, (int)res);
+ tizen_keyrouter_send_keyregister_notify(resource, (int)delivery_mode);
}
static void