Skip to content
This repository was archived by the owner on Jan 4, 2019. It is now read-only.

Mac async popup - #161

Merged
bridiver merged 2 commits into
masterfrom
mac-async-popup
Jun 6, 2017
Merged

bridiver merged 2 commits into
masterfrom
mac-async-popup

Conversation

@bsclifton

@bsclifton bsclifton commented Feb 19, 2017 •

Copy link
Copy Markdown
Member

Manual application of electron patch electron/electron#8702
Additional updates (per electron/electron#8702)

Fixes brave/browser-laptop#5470

  • Default async to true for popup menus
  • fix lint errors
  • 1st commit: menus do not destroy themselves
  • 2nd commit: menus destroy themselves

@bsclifton

Copy link
Copy Markdown
Member Author

Right clicking anywhere inside a tab's webcontents causes this:

[66741:775:0227/015159.905320:ERROR:CONSOLE(219)] "Uncaught Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Error processing argument at index 1, conversion failure from -1
Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Error processing argument at index 1, conversion failure from -1
    at callFunction (/Users/clifton/Documents/browser-laptop-bootstrap/src/out/Release/Brave.app/Contents/Resources/electron.asar/browser/rpc-server.js:226:11)
    at EventEmitter.<anonymous> (/Users/clifton/Documents/browser-laptop-bootstrap/src/out/Release/Brave.app/Contents/Resources/electron.asar/browser/rpc-server.js:316:5)
    at emitMany (events.js:127:13)
    at EventEmitter.emit (events.js:201:7)
    at WebContents.<anonymous> (/Users/clifton/Documents/browser-laptop-bootstrap/src/out/Release/Brave.app/Contents/Resources/electron.asar/browser/api/web-contents.js:173:37)
    at emitTwo (events.js:106:13)
    at WebContents.emit (events.js:191:7)", source: extensions::remote (219)

@kevinsawicki

Copy link
Copy Markdown
Contributor

[66741:775:0227/015159.905320:ERROR:CONSOLE(219)] "Uncaught Error: Could not call remote function ''. Check that the function signature is correct. Underlying error: Error processing argument at index 1, conversion failure from -1

This might be because you need this native mate change: electron/native-mate#10

bsclifton added a commit that referenced this pull request Feb 28, 2017
@bsclifton

bsclifton commented Feb 28, 2017 •

Copy link
Copy Markdown
Member Author

Thanks for the update @kevinsawicki, that definitely got me past that 😄

Seems now though that the menu is closing itself quickly after it opens. Will look at this later tonite
async-popup-mac

@kevinsawicki

Copy link
Copy Markdown
Contributor

Seems now though that the menu is closing itself quickly after it opens. Will look at this later tonite

Haven't seen this before, this could happen if the native menu object gets destroyed too early, that is why they are kept around in a map of nscoped_object until the menu is closed or closePopupAt is called.

@bridiver

Copy link
Copy Markdown
Collaborator

what is the status of this? Still trying to resolve the closing quickly issue?

@bsclifton

Copy link
Copy Markdown
Member Author

@bridiver yes- I haven't tried it recently though. I'm not sure I'll have time to look in this upcoming week

bsclifton added 2 commits May 24, 2017 01:51
Additional updates (per electron/electron#8702)

Fixes brave/browser-laptop#5470

- Default `async` to true for popup menus
- fix lint errors
- menus do not destroy themselves
@bsclifton bsclifton changed the title (NEEDS TESTING) Mac async popup Mac async popup May 24, 2017
@bsclifton
bsclifton requested review from bbondy, bridiver and darkdh May 24, 2017 08:54
@bsclifton

Copy link
Copy Markdown
Member Author

Ready for review! 😄

There are two ways we can attempt to use this:

  • We can use the PR as-is; it will do the destroy when the popup closes. However, I had to grant friend access so that objects could call Destroy
  • We can remove the 2nd commit and then make the caller (ex: browser-laptop) explicitly call menuObject.destroy() when it's ready to be destroyed

Comment thread DEPS
deps = {
"vendor/node": "https://github.com/brave/node.git@f51b9ab8ff446ca7b13be0de1bc12b854b23938d",
"vendor/native_mate": "https://github.com/zcbenz/native-mate.git@b5e5de626c6a57e44c7e6448d8bbaaac475d493c",
"vendor/native_mate": "https://github.com/zcbenz/native-mate.git@ad0fd825663932ee3fa29ff935dfec99933bdd8c",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes- it's needed per the comment here:
#161 (comment)

@bsclifton

Copy link
Copy Markdown
Member Author

browser-laptop portion of this change captured with brave/browser-laptop#9128

@bsclifton

Copy link
Copy Markdown
Member Author

cc: @darkdh

@bridiver

bridiver commented Jun 6, 2017

Copy link
Copy Markdown
Collaborator

would there be any benefit to not destroying them automatically?

@darkdh darkdh left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why not destroying them in OnMenuClosed?
Just like #205 without window id.
If you intentionally make MenuController::Cancel return at first line, you can see the context menu is not window specific but a desktop global on Aura.


int flags = MenuRunner::CONTEXT_MENU |
MenuRunner::HAS_MNEMONICS |
MenuRunner::ASYNC;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
if (gurl.has_username())
dict.Set("auth", gurl.username() + (gurl.has_password() ? ":" + gurl.password() : ""));
dict.Set("auth", gurl.username() + (gurl.has_password()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just saw this now- this just moves part of it onto the next line (since it went over 80 chars length, lint failed)

@bridiver
bridiver merged commit 6f1e346 into master Jun 6, 2017
@bridiver
bridiver deleted the mac-async-popup branch June 6, 2017 21:01
darkdh pushed a commit to brave/browser-laptop that referenced this pull request Jun 6, 2017
darkdh pushed a commit to brave/browser-laptop that referenced this pull request Jun 6, 2017
bsclifton added a commit to brave/browser-laptop that referenced this pull request Jun 7, 2017
@darkdh darkdh mentioned this pull request Jul 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opening a context menu freezes video (ex: Youtube)

4 participants