[M120 Migration][VD] Fix some focus issues for offscreen mode
[platform/framework/web/chromium-efl.git] / tizen_src / chromium_impl / ui / ozone / platform / efl / efl_window.cc
index af45ee1..bd607d9 100644 (file)
@@ -307,6 +307,7 @@ void EflWindow::UpdateFocus(bool focused) {
   if (has_focus_ == focused)
     return;
 
+  LOG(INFO) << "EflWindow Focus:" << focused;
   has_focus_ = focused;
 
   if (events_overlay_) {
@@ -479,7 +480,11 @@ void EflWindow::InitializeEventHandler() {
 
   // Set focus active for a newly opened window.
 #if !defined(BUILD_CHROME)
-  UpdateFocus(true);
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kEnableOffscreenRendering))
+#endif
+    UpdateFocus(true);
 #endif
   efl_event_handler_ = std::make_unique<EflEventHandler>(this);
   PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this);
@@ -495,7 +500,11 @@ void EflWindow::EnsureIMContextEfl() {
 
 void EflWindow::ResetEventHandler() {
   delegate_->OnActivationChanged(false /*active*/);
-  UpdateFocus(false);
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kEnableOffscreenRendering))
+#endif
+    UpdateFocus(false);
   efl_event_handler_.reset();
   PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
 }