[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_event_handler.cc
index d7e93d7..91ca651 100644 (file)
@@ -28,6 +28,8 @@
 #endif
 
 #if BUILDFLAG(IS_TIZEN_TV)
+#include "base/base_switches.h"
+#include "base/command_line.h"
 #include "third_party/blink/public/platform/web_application_type.h"
 #endif
 
@@ -174,7 +176,11 @@ void EflEventHandler::RegisterCallbacks() {
   if (key_events_enabled_)
     AddKeyCallbacks();
 
-  evas_object_focus_set(events_overlay_, EINA_TRUE);
+#if BUILDFLAG(IS_TIZEN_TV)
+  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kEnableOffscreenRendering))
+#endif
+    evas_object_focus_set(events_overlay_, EINA_TRUE);
 
   if (touch_events_enabled_)
     AddTouchCallbacks();