From c8ac6c879d5c21aa7af17d85669228e47d162de3 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 #2512) --- 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 a4b863030..c193ae73c 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);