From 157ad1d57d37fba6b86358ce6d07076f04c6bedb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 21 Sep 2017 07:04:30 -0700 Subject: [PATCH] Linux: Fix client termination (issue #2268) --- libcef/browser/native/window_x11.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index 6ec08c9e3..a8b3c7fb5 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -314,6 +314,16 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { if (!browser_ || browser_->TryCloseBrowser()) { // Allow the close. XDestroyWindow(xdisplay_, xwindow_); + + xwindow_ = None; + + if (browser_.get()) { + // Force the browser to be destroyed and release the reference + // added in PlatformCreateWindow(). + browser_->WindowDestroyed(); + } + + delete this; } } else if (protocol == gfx::GetAtom(kNetWMPing)) { XEvent reply_event = *xev; @@ -327,17 +337,6 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { } break; } - case DestroyNotify: - xwindow_ = None; - - if (browser_.get()) { - // Force the browser to be destroyed and release the reference added - // in PlatformCreateWindow(). - browser_->WindowDestroyed(); - } - - delete this; - break; case FocusIn: // This message is received first followed by a "_NET_ACTIVE_WINDOW" // message sent to the root window. When X11DesktopHandler handles the