Skip to content

Don't wait for xdg-open to exit when OpenExternal is called (Linux) - #5072

Merged
zcbenz merged 3 commits into
electron:masterfrom
sneakypete81:master
Apr 11, 2016
Merged

zcbenz merged 3 commits into
electron:masterfrom
sneakypete81:master

Conversation

@sneakypete81

Copy link
Copy Markdown
Contributor

Some browsers (eg. Firefox) may not return until the browser window is closed. This causes the Electron application to lock up while the browser window is open.

Fixes atom/atom#6320

I'm struggling to properly test this fix, as I can't work out how to use a custom build of Electron when building Atom. Any help with this would be appreciated.

Some browsers (eg. Firefox) may not return until the browser window is
closed. This causes the Electron application to lock up while the browser
window is open.

See atom/atom#6320
@sneakypete81

Copy link
Copy Markdown
Contributor Author

wait_for_exit should be const, of course.

@anaisbetts

Copy link
Copy Markdown
Contributor

This has been trolling us too, 👍

@anaisbetts

Copy link
Copy Markdown
Contributor

@sneakypete81 I'd just test it via the console in the Electron default app - if you've got a repro it should be pretty easy

@zcbenz

zcbenz commented Apr 8, 2016

Copy link
Copy Markdown
Contributor

This would leak processes, I think we can follow Chromium's behavior, by launching a background killer for the process:

  base::Process process = base::LaunchProcess(argv, options);
  if (process.IsValid())
    base::EnsureProcessGetsReaped(process.Pid());

https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/platform_util_linux.cc&q=XDGUtil&sq=package:chromium&type=cs&l=46

@sneakypete81

Copy link
Copy Markdown
Contributor Author

Thanks @zcbenz, good catch.

@paulcbetts I've verified the fix like this:

Steps to reproduce:

  • Make Firefox your default browser
  • Ensure all Firefox windows are closed
  • Start electron without no app
  • Click the "docs" link to launch Firefox
  • Go back to the electron window and attempt to select some text

Before PR
Electron window is frozen, text cannot be selected.
Closing the Firefox window unfreezes the Electron window.

After PR
Electron window is not frozen, text can be selected, links clicked, etc.

@zcbenz

zcbenz commented Apr 11, 2016

Copy link
Copy Markdown
Contributor

👍

@zcbenz
zcbenz merged commit 107d759 into electron:master Apr 11, 2016
@sneakypete81

Copy link
Copy Markdown
Contributor Author

Great, thanks for the feedback and the quick merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Atom freezes when clicking web links in settings tab without the web browser already open

3 participants