aboutsummaryrefslogtreecommitdiff
path: root/rootston/wl_shell.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-21 09:43:24 -0400
committerGitHub <noreply@github.com>2017-10-21 09:43:24 -0400
commit3c7ef3aae68e1a38c0ab83c22c0e064b7bde319e (patch)
treeca85d4ac1f277ca0f997bcffb7adfe36e5157205 /rootston/wl_shell.c
parenta87b60e31e5288c1c3e8c8f94c9a7ccb29e38b54 (diff)
parentce2f945441155fa9d98935dabd6979304f2d2fbc (diff)
Merge branch 'master' into feature/data-device-selection
Diffstat (limited to 'rootston/wl_shell.c')
-rw-r--r--rootston/wl_shell.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/rootston/wl_shell.c b/rootston/wl_shell.c
index 2c6047b1..248514f0 100644
--- a/rootston/wl_shell.c
+++ b/rootston/wl_shell.c
@@ -57,11 +57,8 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
struct roots_wl_shell_surface *roots_surface =
wl_container_of(listener, roots_surface, destroy);
wl_list_remove(&roots_surface->destroy.link);
- wl_list_remove(&roots_surface->ping_timeout.link);
wl_list_remove(&roots_surface->request_move.link);
wl_list_remove(&roots_surface->request_resize.link);
- wl_list_remove(&roots_surface->request_set_fullscreen.link);
- wl_list_remove(&roots_surface->request_set_maximized.link);
view_destroy(roots_surface->view);
free(roots_surface);
}
@@ -88,25 +85,22 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
if (!roots_surface) {
return;
}
- wl_list_init(&roots_surface->destroy.link);
roots_surface->destroy.notify = handle_destroy;
wl_signal_add(&surface->events.destroy, &roots_surface->destroy);
- wl_list_init(&roots_surface->ping_timeout.link);
- wl_list_init(&roots_surface->request_move.link);
roots_surface->request_move.notify = handle_request_move;
wl_signal_add(&surface->events.request_move, &roots_surface->request_move);
- wl_list_init(&roots_surface->request_resize.link);
roots_surface->request_resize.notify = handle_request_resize;
wl_signal_add(&surface->events.request_resize,
&roots_surface->request_resize);
- wl_list_init(&roots_surface->request_set_fullscreen.link);
- wl_list_init(&roots_surface->request_set_maximized.link);
- wl_list_init(&roots_surface->surface_commit.link);
roots_surface->surface_commit.notify = handle_surface_commit;
wl_signal_add(&surface->surface->events.commit,
&roots_surface->surface_commit);
struct roots_view *view = calloc(1, sizeof(struct roots_view));
+ if (!view) {
+ free(roots_surface);
+ return;
+ }
view->type = ROOTS_WL_SHELL_VIEW;
view->wl_shell_surface = surface;
@@ -121,9 +115,8 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
if (surface->state == WLR_WL_SHELL_SURFACE_STATE_TRANSIENT) {
// we need to map it relative to the parent
- int i =
- list_seq_find(desktop->views,
- shell_surface_compare_equals, surface->parent);
+ int i = list_seq_find(desktop->views, shell_surface_compare_equals,
+ surface->parent);
if (i != -1) {
struct roots_view *parent = desktop->views->items[i];
view_set_position(view,