-
Notifications
You must be signed in to change notification settings - Fork 975
Create a Buffer Window in order to pre-render and open new windows faster #12438
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12438 +/- ##
==========================================
- Coverage 56.29% 55.94% -0.36%
==========================================
Files 278 279 +1
Lines 27585 27797 +212
Branches 4497 4550 +53
==========================================
+ Hits 15530 15550 +20
- Misses 12055 12247 +192
|
6ab1e69
to
9205055
Compare
On the Windows platform, new windows that are created from Buffer Windows have their focus stolen by the next created Buffer Window (which happens immediately) due to brave/muon#424 |
9205055
to
27f7bbd
Compare
This is no longer blocked since brave/muon#424 is fixed, and is ready for review @bsclifton. I added a few test cases to this PR. |
@petemill please rebase |
27f7bbd
to
3935587
Compare
@NejcZdovc good catch - rebased! |
3935587
to
2d8b111
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.
Great job on this one! The change is extremely noticeable; this'll be huge
I reviewed the rest of the way, didn't find any additional problems. Just wanted to call out the two issues we saw when debugging together:
- When detaching, extra properties were not handled resulting in a new window being created (instead of using buffered). These properties had the following values:
disposition: undefined,
positionByMouseCursor: true,
checkMaximized: true
- When exiting, it seems like the buffered window is being saved. ex: closing with 1 window results in 2 windows when relaunching. Closing with 2 windows results in 3 windows when relaunching
…s more instantly A buffer window is created at startup, and any time a previous buffer window is detached in order to be utilized as a real window. This type of window is not shown and has no tabs (pinned or non-pinned) until it is shown. State is not persisted for Buffer Windows until they are utilized as real windows. A new command-line flag is introduced: '--debug-window-events' which shows logging around Buffer Window creation and utilization, as well as all other window events. No additional logging should be present without this flag. Fix #12437
2d8b111
to
0cb6385
Compare
Thanks @bsclifton for finding those issues. I have fixed those issues and updated the description with three additional test cases:
I also found that the focused window wasn't restored as the focused window on app restart. I fixed it because I thought it was a regression introduced here, but looks like it wasn't, so I created another PR for it at #13161 |
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.
Ran through steps and it's looking great! I ensured logging correctly showed buffer being used for popups and when detaching. Pinned tabs worked as expected. Nice work! 😄 👍
Create a Buffer Window in order to pre-render and open new windows faster
Create a Buffer Window in order to pre-render and open new windows faster
A buffer window is created at startup, and any time a previous buffer window is detached in order to be utilized as a real window.
This type of window is not shown and has no tabs (pinned or non-pinned) until it is shown.
State is not persisted for Buffer Windows until they are utilized as real windows.
A new command-line flag is introduced: '--debug-window-events' which shows logging around Buffer Window creation and utilization, as well as all other window events. No additional logging should be present without this flag.
I had built some of this functionality for #11720 (Tabs transitions) in order to decrease the time to detach a tab to a new window. At the same time, a request came through Asana for the performance initiative to do this same thing for every window. This PR is the result of adapting the code from #11720 for all (compatible) window creation.
Fix #12437
Test Plan:
Window creation
Window + frame creation
Window persistance
Pinned tabs
Window focus (especially for Windows OS due to brave/muon#424)
Especially on Windows: ensure that always when a new window is created, that the new window gets and keeps focus (in the url bar for example)
Detach tab to new window
Popup window
Logging
start Brave with the flag
--debug-window-events
start brave without the above flag
Submitter Checklist:
git rebase -i
to squash commits (if needed).Reviewer Checklist:
Tests