This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 970
Menu items which need a window will create / show one if needed #13749
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #13749 +/- ##
==========================================
- Coverage 56.78% 56.77% -0.01%
==========================================
Files 285 285
Lines 29038 29042 +4
Branches 4803 4800 -3
==========================================
+ Hits 16488 16489 +1
- Misses 12550 12553 +3
|
13 tasks
718bbd1
to
fe52ce2
Compare
@petemill looks like a lot of the items called out in #8164 don't work: When doing many of those, I'm getting this error via stdout:
|
Fix #13689 This bug was caused because menu items were using a hidden window for their new tabs. We should _not_ use `electron{.remote}.BrowserWindow.getAllWindows()` or `.get{Active, Focused}Window` directly. There are two reasons that could have bad results: 1. We create BrowserWindows which are not normal tabbed renderer windows (e.g. some code that runs on Bookmark creation) 2. We have a hidden window sometimes (the Buffer Window) Instead call `app/browser/window.js`: `getAllRendererWindows` and `getActiveWindowId`. Fix for main menu actions, which can be called when there are no windows, but when searching for `BrowserWindow.` Test Plan: - Check all menu items open new tab in currently active window - Check all menu items open new tab in currently active window, when app is not focused - Check all menu items open new tab in new window if there is no visible window - Check tabs in all windows are persisted on restart when app / windows close - Check process quits in Windows when last visible window is closed
fe52ce2
to
e329340
Compare
bsclifton
approved these changes
Apr 6, 2018
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.
Works great! 😄 👍
bsclifton
added a commit
that referenced
this pull request
Apr 6, 2018
Menu items which need a window will create / show one if needed
bsclifton
added a commit
that referenced
this pull request
Apr 6, 2018
Menu items which need a window will create / show one if needed
10 tasks
petemill
pushed a commit
that referenced
this pull request
Apr 19, 2018
Menu items which need a window will create / show one if needed
0.22.x-c66 a415cb0 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #13689
Partially addresses some items in #8164
This bug was caused because menu items were using a hidden window for their new tabs.
We should not use
electron{.remote}.BrowserWindow.getAllWindows()
or.get{Active, Focused}Window
directly. There are two reasons that could have bad results:Instead call
app/browser/window.js
:getAllRendererWindows
andgetActiveWindowId
.Fix for main menu actions, which can be called when there are no windows, but when searching for
BrowserWindow.
Test Plan:
Submitter Checklist:
git rebase -i
to squash commits (if needed).Reviewer Checklist:
Request a security/privacy review as needed if one was not already requested.
Adequate test coverage exists to prevent regressions
Tests should be independent and work correctly when run individually or as a suite ref
New files have MPL2 license header