Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: gtk_init() was called twice in AtomBrowserMainParts #19986

Merged
merged 1 commit into from Aug 28, 2019

Conversation

ckerr
Copy link
Member

@ckerr ckerr commented Aug 27, 2019

Description of Change

Fixes #19984.

This one's super simple: don't call gtk_init() twice.

CC @codebytere

Checklist

Release Notes

Notes: Fixed Linux console warning about gtk_disable_setlocale().

@ckerr ckerr requested a review from codebytere August 27, 2019 17:26
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Aug 27, 2019
@codebytere
Copy link
Member

Do we know why this was introduced to begin with?

@ckerr
Copy link
Member Author

ckerr commented Aug 27, 2019

Funny thing, we're calling gtk_init() twice in 6-0-x too. 🤦‍♂️

What's changed is that Chromium added a call to gtk_disable_setlocale() in libgtkui::GtkInitFromCommandLine which triggered the warning s.t. now we're noticing it.

https://chromium.googlesource.com/chromium/src/+/218cc85df6ba817c2f33e91108345974e3293d63

@ckerr
Copy link
Member Author

ckerr commented Aug 28, 2019

A little more context on this, for posterity's sake

First call

#0  0x00007fffcf00cb20 in gtk_init () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#1  0x00007fffd2a6ab92 in (anonymous namespace)::CommonInitFromCommandLine(base::CommandLine const&) (command_line=...)
    at ./../../chrome/browser/ui/libgtkui/gtk_util.cc:67
#2  0x00007fffd2a65c25 in libgtkui::GtkInitFromCommandLine(base::CommandLine const&) (command_line=...)
    at ./../../chrome/browser/ui/libgtkui/gtk_util.cc:85
#3  0x00007fffd2a65b2e in libgtkui::GtkUi::GtkUi() (this=0xe7a80985d60) at ./../../chrome/browser/ui/libgtkui/gtk_ui.cc:345
#4  0x00007fffd2a6a96e in BuildGtkUi() () at ./../../chrome/browser/ui/libgtkui/gtk_ui.cc:1075
#5  0x0000555556b030e1 in electron::AtomBrowserMainParts::PreEarlyInitialization() (this=0xe7a80944aa0)
    at ../../electron/shell/browser/atom_browser_main_parts.cc:269

Second call

#0  0x00007fffcf00cb20 in gtk_init () at /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#1  0x00007fffd2a6ab92 in (anonymous namespace)::CommonInitFromCommandLine(base::CommandLine const&) (command_line=...)
    at ./../../chrome/browser/ui/libgtkui/gtk_util.cc:67
#2  0x00007fffd2a65c25 in libgtkui::GtkInitFromCommandLine(base::CommandLine const&) (command_line=...)
    at ./../../chrome/browser/ui/libgtkui/gtk_util.cc:85
#3  0x0000555556b03820 in electron::AtomBrowserMainParts::PreMainMessageLoopRun() (this=0xe7a80944aa0)
    at ../../electron/shell/browser/atom_browser_main_parts.cc:464

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Aug 28, 2019
@ckerr ckerr merged commit 217ed9a into master Aug 28, 2019
@release-clerk
Copy link

release-clerk bot commented Aug 28, 2019

Release Notes Persisted

Fixed Linux console warning about gtk_disable_setlocale().

@ckerr ckerr deleted the dont-call-gtk-init-twice branch August 28, 2019 17:36
@trop
Copy link
Contributor

trop bot commented Aug 28, 2019

I have automatically backported this PR to "7-0-x", please check out #20012

ckerr added a commit that referenced this pull request Aug 28, 2019
Runs that flake 100 times instead of just once.
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.

In 7-0-x and master, Electron on Linux gives a gtk_disable_setlocale() warning on startup
3 participants