mirror of
https://github.com/swaywm/sway.git
synced 2026-04-20 06:47:03 -04:00
view: init function should return a success bool
This commit is contained in:
parent
b4d7e84d38
commit
dbd2fbf430
4 changed files with 11 additions and 4 deletions
|
|
@ -548,7 +548,10 @@ void handle_xdg_shell_toplevel(struct wl_listener *listener, void *data) {
|
|||
return;
|
||||
}
|
||||
|
||||
view_init(&xdg_shell_view->view, SWAY_VIEW_XDG_SHELL, &view_impl);
|
||||
if (!view_init(&xdg_shell_view->view, SWAY_VIEW_XDG_SHELL, &view_impl)) {
|
||||
free(xdg_shell_view);
|
||||
return;
|
||||
}
|
||||
xdg_shell_view->view.wlr_xdg_toplevel = xdg_toplevel;
|
||||
|
||||
xdg_shell_view->map.notify = handle_map;
|
||||
|
|
|
|||
|
|
@ -796,7 +796,10 @@ struct sway_xwayland_view *create_xwayland_view(struct wlr_xwayland_surface *xsu
|
|||
return NULL;
|
||||
}
|
||||
|
||||
view_init(&xwayland_view->view, SWAY_VIEW_XWAYLAND, &view_impl);
|
||||
if (!view_init(&xwayland_view->view, SWAY_VIEW_XWAYLAND, &view_impl)) {
|
||||
free(xwayland_view);
|
||||
return NULL;
|
||||
}
|
||||
xwayland_view->view.wlr_xwayland_surface = xsurface;
|
||||
|
||||
wl_signal_add(&xsurface->events.destroy, &xwayland_view->destroy);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue