Check for frame being NULL before setting/unsetting flags
authorDima Ryazanov <dima@gmail.com>
Fri, 15 Nov 2013 10:01:19 +0000 (02:01 -0800)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 4 Dec 2013 00:12:54 +0000 (16:12 -0800)
Fixes a crash in Firefox when clicking an "install plugin" popup.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
src/xwayland/window-manager.c

index 5ee9480..6d29026 100644 (file)
@@ -695,12 +695,14 @@ weston_wm_window_activate(struct wl_listener *listener, void *data)
        }
 
        if (wm->focus_window) {
-               frame_unset_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE);
+               if (wm->focus_window->frame)
+                       frame_unset_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE);
                weston_wm_window_schedule_repaint(wm->focus_window);
        }
        wm->focus_window = window;
        if (wm->focus_window) {
-               frame_set_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE);
+               if (wm->focus_window->frame)
+                       frame_set_flag(wm->focus_window->frame, FRAME_FLAG_ACTIVE);
                weston_wm_window_schedule_repaint(wm->focus_window);
        }
 }