#define SESSION_COUNTER_INTERVAL 0.1
#define MAIN_LOOP_INTERVAL 1
+static const float FirstFrameDelayWaitTime = 2.0f;
+
using namespace extensions;
namespace runtime {
lang_changed_mode_(false),
is_terminate_called_(false),
is_close_page_called_(false),
+ is_window_inactive_(false),
ewk_context_(
ewk_context_new_with_injected_bundle_path(INJECTED_BUNDLE_PATH)),
+ firstframe_delay_timer_(NULL),
has_ownership_of_ewk_context_(true),
window_(window),
appid_(app_data->app_id()),
lang_changed_mode_(false),
is_terminate_called_(false),
is_close_page_called_(false),
+ is_window_inactive_(false),
ewk_context_(context),
+ firstframe_delay_timer_(NULL),
has_ownership_of_ewk_context_(false),
window_(window),
appid_(app_data->app_id()),
if (view_stack_.size() > 0 && view_stack_.front() != NULL)
view_stack_.front()->SetVisibility(true);
+ is_window_inactive_ = false;
if (app_data_->setting_info() != NULL &&
app_data_->setting_info()->background_support_enabled()) {
return;
if (view_stack_.size() > 0 && view_stack_.front() != NULL)
view_stack_.front()->SetVisibility(false);
+ is_window_inactive_ = true;
if (app_data_->setting_info() != NULL &&
app_data_->setting_info()->background_support_enabled()) {
LOGGER(DEBUG) << "gone background (backgroud support enabed)";
void WebApplication::Terminate() {
// Just process closing page once.
+ is_window_inactive_ = false;
if (is_terminate_called_ || is_close_page_called_)
return;
ecore_main_loop_begin();
ecore_timer_del(main_loop.timer);
ecore_timer_del(session_counter.timer);
+ UnsetTimeout();
}
void WebApplication::ClosePage() {
LOGGER(DEBUG) << "Rendered";
splash_screen_->HideSplashScreen(SplashScreen::HideReason::RENDERED);
+ if (firstframe_delay_timer_) {
+ UnsetTimeout();
+ }
+
// Set web view into Web voice touch agent
if (NULL != vc_webview_) {
vc_webview_->vc_webview_set_view(view->evas_object());
}
// Do not show(), active() for language change
- if(lang_changed_mode_ == false){
- // Show window after frame rendered.
+ if(lang_changed_mode_ == false &&
+ is_window_inactive_ == false) {
+ // Show window after frame rendered.
if (common::getProfile() == common::kPROFILE_MOBILE) {
if (common::utils::StartsWith(view->GetUrl(), kFileScheme)) {
window_->Show();
popup->Show();
}
+void WebApplication::SetTimeoutFirstFrameDelay() {
+ LOGGER(DEBUG);
+ firstframe_delay_timer_ = ecore_timer_add(
+ FirstFrameDelayWaitTime,
+ FirstFrameDelayTimerCallback, this);
+}
+
+Eina_Bool WebApplication::FirstFrameDelayTimerCallback(void* data) {
+ LOGGER(DEBUG);
+ WebApplication* This = static_cast<WebApplication*>(data);
+ /* Do not show(), active() when window is already in background */
+ if(This->is_window_inactive_ == false) {
+ This->window_->Show();
+ This->window_->Active();
+ }
+ This->firstframe_delay_timer_ = NULL;
+ return ECORE_CALLBACK_CANCEL;
+}
+
+void WebApplication::UnsetTimeout() {
+ LOGGER(DEBUG);
+ if (firstframe_delay_timer_) {
+ ecore_timer_del(firstframe_delay_timer_);
+ firstframe_delay_timer_ = NULL;
+ }
+}
+
} // namespace runtime