#include "e_keyrouter_private.h"
+// workaround to show default window effect for the
+// w-home main window when home key is pressed.
+#include "services/e_service_launcher.h"
+
static void _e_keyrouter_send_key_events(int type, Ecore_Event_Key *ev);
static void _e_keyrouter_send_key_events_press(int type, Ecore_Event_Key *ev);
static void _e_keyrouter_send_key_events_release(int type, Ecore_Event_Key *ev);
KLINF("Release Pair : %s(%s:%d)(Focus: %d)(Status: %d) => wl_surface (%p) wl_client (%p) (pid: %d) (pname: %s)",
((ECORE_EVENT_KEY_DOWN == type) ? "Down" : "Up"), ev->keyname, ev->keycode, key_node_data->focused,
key_node_data->status, key_node_data->surface, key_node_data->wc, pid, pname ?: "Unknown");
+
+ // workaround to show default window effect for the
+ // w-home main window when home key is pressed.
+ if ((type == ECORE_EVENT_KEY_UP) &&
+ (key_node_data->surface) &&
+ !(e_util_strcmp(ev->keyname, "XF86PowerOff")))
+ {
+ E_Client *_ec = wl_resource_get_user_data(key_node_data->surface);
+ if (_ec) e_service_launcher_home_key_up_handle(_ec);
+ }
+
if(pname) E_FREE(pname);
if(cmd) E_FREE(cmd);
}
Eina_Bool swl_done; //flag indicating done of callee
Eina_Bool block_input; //input is blocked(1) or not(0) while running client side animation
+
+ Eina_Bool home_key_pressed; //workaround to show default window effect for the
+ //w-home main window when home key is pressed.
};
struct _E_Service_Launcher_Handler
E_Service_Launcher *runner, *pre_runner = NULL;
E_Client *activity = NULL, *prov_ec = NULL;
Launcher_State new_state;
+ Eina_Bool res = EINA_TRUE;
EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
ELOGF("LAUNCHER_SRV", "Current activity(%p, is_del:%d) was launched by launcher.",
ec, activity, e_object_is_del(E_OBJECT(activity)));
+ // workaround to show default window effect for the
+ // w-home main window when home key is pressed.
+ if (lc->home_key_pressed)
+ {
+ ELOGF("LAUNCHER_SRV", "HomeKey was pressed. Ignore client-side launching effect. activity_ec:%p", ec, activity);
+ e_policy_animatable_lock(lc->launched_ec, E_POLICY_ANIMATABLE_CUSTOMIZED, 0);
+ goto finish;
+ }
+
//check state of lc
runner = _launcher_handler_launcher_runner_get();
if (runner == lc)
ELOGF("LAUNCHER_SRV",
"Launcher(%s) is already runner, do nothing",
lc->ec, _launcher_state_to_str(lc->state));
- return EINA_TRUE;
+ goto finish;
}
pre_runner = _launcher_handler_launcher_pre_runner_get();
new_state = LAUNCHER_STATE_PREPARING;
}
-
- if (!sent) return EINA_FALSE;
+ if (!sent)
+ {
+ res = EINA_FALSE;
+ goto finish;
+ }
_launcher_state_set(lc, new_state);
_launcher_handler_launcher_runner_set(lc);
}
}
- return EINA_TRUE;
+finish:
+ // workaround to show default window effect for the
+ // w-home main window when home key is pressed.
+ if (lc->home_key_pressed)
+ {
+ lc->home_key_pressed = EINA_FALSE;
+ ELOGF("LAUNCHER_SRV", "HomeKey Pressed:1->0", ec);
+ }
+ return res;
}
static Eina_Bool
}
}
}
+
+// workaround to show default window effect for the
+// w-home main window when home key is pressed.
+EINTERN void
+e_service_launcher_home_key_up_handle(E_Client *ec)
+{
+ E_Service_Launcher *lc, *pre_runner;
+
+ if (!ec) return;
+ if (!e_policy_client_is_home_screen(ec)) return;
+
+ lc = _launcher_handler_launcher_find(ec);
+ if (!lc) return;
+
+ pre_runner = _launcher_handler_launcher_pre_runner_get();
+
+ ELOGF("LAUNCHER_SRV", "HomeKey Check launcher:%s pre_runner:%p",
+ ec,
+ lc == pre_runner ? "true" : "false",
+ pre_runner ? pre_runner->ec : NULL);
+
+ if (pre_runner != lc) return;
+ if (lc->home_key_pressed) return;
+
+ lc->home_key_pressed = EINA_TRUE;
+
+ ELOGF("LAUNCHER_SRV", "HomeKey Pressed:0->1", ec);
+}
+
+// workaround to show default window effect for the
+// w-home main window when home key is pressed.
+EINTERN void
+e_service_launcher_home_key_up_cleanup(E_Client *ec)
+{
+ E_Service_Launcher *lc;
+
+ if (!ec) return;
+
+ lc = _launcher_handler_launcher_find(ec);
+ if (!lc) return;
+
+ if (!lc->home_key_pressed) return;
+
+ lc->home_key_pressed = EINA_FALSE;
+
+ ELOGF("LAUNCHER_SRV", "HomeKey Pressed:1->0 VIS...", ec);
+}