]> git.mdlowis.com Git - proto/labwc.git/commitdiff
foreign: handle output error gracefully
authorJohan Malm <jgm323@gmail.com>
Sun, 22 Aug 2021 18:14:15 +0000 (19:14 +0100)
committerJohan Malm <jgm323@gmail.com>
Sun, 22 Aug 2021 18:14:15 +0000 (19:14 +0100)
src/foreign.c

index ccab98b9c1b1623e57fa6d5f837c5024f4b6f5f6..46d7448602f9244f191a426f1e5dfc099e9f99c7 100644 (file)
@@ -30,8 +30,14 @@ foreign_toplevel_handle_create(struct view *view)
        }
 
        view_update_title(view);
+       struct wlr_output *wlr_output = view_wlr_output(view);
+       if (!wlr_output) {
+               wlr_log(WLR_ERROR, "no wlr_output for (%s)",
+                       view->impl->get_string_prop(view, "title"));
+               return;
+       }
        wlr_foreign_toplevel_handle_v1_output_enter(view->toplevel_handle,
-               view_wlr_output(view));
+               wlr_output);
 
        view->toplevel_handle_request_maximize.notify =
                handle_toplevel_handle_request_maximize;