-
Notifications
You must be signed in to change notification settings - Fork 973
windows restore in the correct order to ensure correct focused window #13161
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13161 +/- ##
==========================================
- Coverage 56.18% 56.15% -0.03%
==========================================
Files 279 279
Lines 27873 27895 +22
Branches 4560 4564 +4
==========================================
+ Hits 15660 15665 +5
- Misses 12213 12230 +17
|
5eda49a
to
8d2a42e
Compare
@@ -77,6 +77,9 @@ ipc.on(messages.INITIALIZE_WINDOW, (e, mem) => { | |||
const windowValue = message.windowValue | |||
|
|||
currentWindow.setWindowId(windowValue.id) | |||
if (process.env.NODE_ENV === 'development') { | |||
console.debug(`This Window's ID is:`, windowValue.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little something in each window's console.log to aid window debugging (when in dev mode, and set to show debug messages).
@@ -752,21 +750,18 @@ const doAction = (action) => { | |||
} | |||
break | |||
} | |||
case windowConstants.WINDOW_ON_WINDOW_UPDATE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constant does not exist
let windowValue = makeImmutable(action.windowValue) | ||
|
||
if (windowValue.get('focused')) { | ||
windowValue = windowValue.set('focusTime', performance.timing.navigationStart + performance.now()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be set whenever window is updated (not only when it's ready) as we want to save when each window last had focus. Also we can use new Date().getTime()
as milliseconds are perfectly fine, we don't need to resolve to a microsecond for this.
…dex is restored and the previously-focused window gets focus Fix #13158
8d2a42e
to
a0133fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great- I tested before and after and confirmed the fix 😄 👍
windows restore in the correct order to ensure correct focused window
windows restore in the correct order to ensure correct focused window
Do not merge before #12438 since it's best to test this fix with those changes too as that PR changes a lot of window logic. This PR should only show 1 commit to merge.
Fix #13158
Note that this test plan may never be 100% robust, but this gets us closer.
There will be additional cases that cannot reproduce success (i.e. if a window is macOS fullscreen), but the code to 'fix' those scenarios would likely introduce new issues and/or not be maintainable, for arguably small benefit.
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
On #13158
Reviewer Checklist:
Tests