From 49c149c20b4e95c38a0a4a568e54ee1904412ece Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 10 Oct 2018 13:41:34 +0300 Subject: [PATCH] Linux: cefclient: Fix crash when creating popup window (issue #1006) --- tests/cefclient/browser/browser_window_std_gtk.cc | 2 +- tests/cefclient/browser/root_window_gtk.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cefclient/browser/browser_window_std_gtk.cc b/tests/cefclient/browser/browser_window_std_gtk.cc index b0e633223..30ca8f14f 100644 --- a/tests/cefclient/browser/browser_window_std_gtk.cc +++ b/tests/cefclient/browser/browser_window_std_gtk.cc @@ -162,7 +162,7 @@ void BrowserWindowStdGtk::Hide() { void BrowserWindowStdGtk::SetBounds(int x, int y, size_t width, size_t height) { REQUIRE_MAIN_THREAD(); - if (browser_) { + if (xdisplay_ && browser_) { ::Window xwindow = browser_->GetHost()->GetWindowHandle(); DCHECK(xwindow); SetXWindowBounds(xdisplay_, xwindow, x, y, width, height); diff --git a/tests/cefclient/browser/root_window_gtk.cc b/tests/cefclient/browser/root_window_gtk.cc index 512a79c54..02451a28a 100644 --- a/tests/cefclient/browser/root_window_gtk.cc +++ b/tests/cefclient/browser/root_window_gtk.cc @@ -369,6 +369,7 @@ void RootWindowGtk::CreateRootWindow(const CefBrowserSettings& settings, // Set the Display associated with the browser. ::Display* xdisplay = GDK_WINDOW_XDISPLAY(gtk_widget_get_window(window_)); + CHECK(xdisplay); if (with_osr_) { static_cast(browser_window_.get()) ->set_xdisplay(xdisplay);