x11, ozone/linux: Initialize GTK after Ozone
GtkUi is currently already used in Ozone X11. Ozone platform initialization code calls XInitThreads() function to init Xlib in threaded mode under certain conditions**, which according to the docs should be called before any other Xlib call [1]. However, GTK is initialized before Ozone platform, which makes Gtk to create/init X11 connection object before calling XInitThreads(), that's wrong and causes crashes when Gtk file dialogs are instantiated/shown (among other potential issues not observed so far). Present CL simplifies GtkUi initialization, moving it entirely to ToolkitInitialized() override, which happens just after aura::Env's initialization (which actually init OzonePlatform global object) and before initializing Views framework, so that code previously in PreCreateThreads() could be moved and unified under in a single method. As follow-up, crrev.com/c/1863940 fixes the remaining issues that were preventing file dialogs to work in Ozone X11. ** Actually current Ozone X11 calls it always, but that must be changed soon to do so only in some cases. E.g: in-process-gpu, single-process, etc. Issue tracked under https://crbug.com/1024477. [1] https://www.x.org/releases/X11R7.5/doc/man/man3/XInitThreads.3.html Bug: 1008755 Change-Id: Idc81e94dc236257bd7693bfe13833239bbb0fa87 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899796 Commit-Queue: Nick Yamane <nickdiego@igalia.com> Reviewed-by:Thomas Anderson <thomasanderson@chromium.org> Reviewed-by:
Michael Spang <spang@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#716908}
Showing
Please register or sign in to comment