Fix issue in multi view(window) scenario 12/256312/10
authorliwei <wei90727.li@samsung.com>
Thu, 1 Apr 2021 05:26:55 +0000 (13:26 +0800)
committerliwei <wei90727.li@samsung.com>
Tue, 11 May 2021 08:09:28 +0000 (16:09 +0800)
This patch fix issue when app use "window.open("***.html")".

ex. newpage = window.open ('page.html', 'page', 'height=100,
    width=800, top=100, left=100')

If main window's "ready to show" event is invoked after
newpage create("browser-window-created" event), WRT need show
the latest view(window) in window list.
Native Patch:
https://review.tizen.org/gerrit/257970/

Change-Id: I4c5c5b7930de4509cda52a8a8147de0b36d57f97
Signed-off-by: liwei <wei90727.li@samsung.com>
wrt_app/src/web_application.ts

index f2e3d1a502735637294b14e53236f17ec2d6a75f..fc4b51e4af2b4d52efdeb7238c92e5622d488788 100644 (file)
@@ -367,8 +367,11 @@ export class WebApplication {
     if (this.profileDelegate.backgroundExecutable()) {
       console.log('skip showing while backgroundExecution mode');
     } else if (!this.mainWindow.isVisible()) {
-      console.log('show window');
+      console.log(`show this.windowList.length : ${this.windowList.length}`);
       this.mainWindow.show();
+      if (this.windowList.length > 1) {
+        this.windowList[this.windowList.length - 1].moveTop();
+      }
     }
     this.profileDelegate.show();
   }