[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 8d80b786a8086652b6f600cecd08bab9c38ed7f2..648ccb4a1fc3001b699bbe889dcda20277ae2144 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 683515fd3b0de8982bd55ae69416fd2d80ea53d9..8a2973300da22dceb9a4d4179e968becf67a4c70 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 b68bf17d60f6b4b53ff235dbaf1342385607e389..1ba13d71923d1ddd48ba8cb30710a53871115076 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);
+        }
       });
     });