[VD] Set focus of last web contents 54/264954/4
authorDongHyun Song <dh81.song@samsung.com>
Wed, 6 Oct 2021 04:39:33 +0000 (13:39 +0900)
committerSangYong Park <sy302.park@samsung.com>
Thu, 7 Oct 2021 01:52:28 +0000 (01:52 +0000)
After closed another WRTWindow, the last web contents has no focus
until any registered key is handled.
This patch will give focus on the last web contents when WRTWindow
closed.

Related patch:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/264955/

Change-Id: I43475272f757a05be05aa51ca7ff5dbac659bf6b
Signed-off-by: DongHyun Song <dh81.song@samsung.com>
wrt_app/common/web_application_delegate.ts
wrt_app/src/tv/web_application_tv.ts
wrt_app/src/web_application.ts

index 8d80b78..648ccb4 100644 (file)
@@ -29,6 +29,7 @@ export class WebApplicationDelegate {
   canIgnoreSuspend() { return false; }
   clearCache() { }
   clearSuface(webContents: any) { }
+  focus(webContents: any) { }
   handleAppControlEvent(appControl: any) { return true; }
   handleProxyInfo(authInfo: any, callback: any) { return false; }
   initialize(options: RuntimeOption) { }
index 683515f..8a29733 100644 (file)
@@ -264,4 +264,8 @@ Then you can get profile log from the initial loading.`;
   profileName() {
     return 'TV';
   }
+
+  focus(webContents: any) {
+    this.tv.focus(webContents);
+  }
 }
index b68bf17..1ba13d7 100755 (executable)
@@ -69,8 +69,11 @@ export class WebApplication {
         console.log(`window closed : #${this.windowList.length}`);
         let index = this.windowList.indexOf(window);
         this.windowList.splice(index, 1);
-        if (!this.inQuit && index === this.windowList.length && this.windowList.length > 0)
-          this.windowList[this.windowList.length - 1].show();
+        if (!this.inQuit && index === this.windowList.length && this.windowList.length > 0) {
+          let lastWindow = this.windowList[this.windowList.length - 1];
+          lastWindow.show();
+          this.profileDelegate.focus(lastWindow.webContents);
+        }
       });
     });