From cae1f0ff2d2dfd293a27fa142865aacf012e6cd3 Mon Sep 17 00:00:00 2001 From: Dima Ryazanov Date: Fri, 15 Nov 2013 02:02:23 -0800 Subject: [PATCH] Check if the frame exists before reading its size This fixes crashes caused by popup windows that don't have override_redirect (e.g., menus in VLC and KDE apps). Signed-off-by: Dima Ryazanov Reviewed-by: Axel Davy --- src/xwayland/window-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c index 6d290266..eea03496 100644 --- a/src/xwayland/window-manager.c +++ b/src/xwayland/window-manager.c @@ -497,7 +497,7 @@ weston_wm_window_get_frame_size(struct weston_wm_window *window, if (window->fullscreen) { *width = window->width; *height = window->height; - } else if (window->decorate) { + } else if (window->decorate && window->frame) { *width = frame_width(window->frame); *height = frame_height(window->frame); } else { @@ -515,7 +515,7 @@ weston_wm_window_get_child_position(struct weston_wm_window *window, if (window->fullscreen) { *x = 0; *y = 0; - } else if (window->decorate) { + } else if (window->decorate && window->frame) { frame_interior(window->frame, x, y, NULL, NULL); } else { *x = t->margin;