Commit 6d745d78 authored by Jacobo Aragunde Pérez's avatar Jacobo Aragunde Pérez Committed by Commit Bot

Check if parent_window exists before clearing transient state.

It could happen that the dialog window is closed because the parent
window was closed (e.g. Ctrl+C on Chrome running on terminal). In that
case, the parent X11Window object doesn't exist any more, and calling
it would cause a segfault.

Bug: 1104585
Change-Id: I3aee31c5fa9e567f55e0317d9df8c675502ff990
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300094Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarNick Yamane <nickdiego@igalia.com>
Commit-Queue: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Cr-Commit-Position: refs/heads/master@{#789436}
parent eb807a35
...@@ -63,7 +63,9 @@ bool GtkUiDelegateX11::SetGdkWindowTransientFor(GdkWindow* window, ...@@ -63,7 +63,9 @@ bool GtkUiDelegateX11::SetGdkWindowTransientFor(GdkWindow* window,
void GtkUiDelegateX11::ClearTransientFor(gfx::AcceleratedWidget parent) { void GtkUiDelegateX11::ClearTransientFor(gfx::AcceleratedWidget parent) {
ui::X11Window* parent_window = ui::X11Window* parent_window =
ui::X11WindowManager::GetInstance()->GetWindow(parent); ui::X11WindowManager::GetInstance()->GetWindow(parent);
parent_window->SetTransientWindow(x11::Window::None); // parent_window might be dead if there was a top-down window close
if (parent_window)
parent_window->SetTransientWindow(x11::Window::None);
} }
GdkDisplay* GtkUiDelegateX11::GetGdkDisplay() { GdkDisplay* GtkUiDelegateX11::GetGdkDisplay() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment