From ae6e2717c57fc22286cb29d84dfd1198d7ebc417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 26 Jan 2012 11:09:20 -0500 Subject: [PATCH] window: Don't crash when window with focus_widget is destroyed We would try to deliver a leave event to a widget in a destroyed window. --- clients/window.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/window.c b/clients/window.c index 1356c75c0..7ba6a2293 100644 --- a/clients/window.c +++ b/clients/window.c @@ -974,6 +974,9 @@ window_destroy(struct window *window) input->pointer_focus = NULL; if (input->keyboard_focus == window) input->keyboard_focus = NULL; + if (input->focus_widget && + input->focus_widget->window == window) + input->focus_widget = NULL; } if (window->frame)