Patch: fix weston crash

Submitted by Andrew Engelbrecht on Dec. 2, 2014, 5:18 p.m.


Message ID
State Accepted
Commit 4c5a6f7a18d22703520ea5ece7f126d2629cc909
Headers show

Not browsing as part of any series.

Commit Message

Andrew Engelbrecht Dec. 2, 2014, 5:18 p.m.
To produce the bug, build and run: (you don't need the game data to test)

$ mv ~/.config/flare ~/.config/flare.bak
$ ./flare  # click 'configure', set full screen mode then click 'ok'
           # weston will crash and dump core.

I've attached a patch which fixes the crashing. I mimicked the code in
the block above it without knowing the overall impact, so it needs
review from a knowledgeable contributor.

Patch hide | download patch | download mbox

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index bdfac23..9284a05 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1326,7 +1326,9 @@  weston_wm_window_handle_state(struct weston_wm_window *window,
 								0, NULL);
 		} else {
-			shell_interface->set_toplevel(window->shsurf);
+			if (window->shsurf)
+				shell_interface->set_toplevel(window->shsurf);
 			window->width = window->saved_width;
 			window->height = window->saved_height;
 			if (window->frame)