From 97f29ec67f0937dd34343fd50ff5b4fa6840f5f3 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Tue, 21 Apr 2020 20:55:06 -0500 Subject: [PATCH] no need to manage unmapped clients is there? --- dwl.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/dwl.c b/dwl.c index fe834a1..116a859 100644 --- a/dwl.c +++ b/dwl.c @@ -57,7 +57,6 @@ typedef struct { struct wl_listener destroy; struct wl_listener request_move; struct wl_listener request_resize; - bool mapped; int x, y; } Client; @@ -289,9 +288,6 @@ createnotify(struct wl_listener *listener, void *data) wl_signal_add(&xdg_surface->events.unmap, &c->unmap); c->destroy.notify = destroynotify; wl_signal_add(&xdg_surface->events.destroy, &c->destroy); - - /* Add it to the list of clients. */ - wl_list_insert(&clients, &c->link); } void @@ -320,7 +316,6 @@ destroynotify(struct wl_listener *listener, void *data) { /* Called when the surface is destroyed and should never be shown again. */ Client *c = wl_container_of(listener, c, destroy); - wl_list_remove(&c->link); free(c); } @@ -477,7 +472,9 @@ maprequest(struct wl_listener *listener, void *data) { /* Called when the surface is mapped, or ready to display on-screen. */ Client *c = wl_container_of(listener, c, map); - c->mapped = true; + + /* Insert this client into the list and focus it. */ + wl_list_insert(&clients, &c->link); focus(c, c->xdg_surface->surface); } @@ -702,10 +699,6 @@ rendermon(struct wl_listener *listener, void *data) * our client list is ordered front-to-back, we iterate over it backwards. */ Client *c; wl_list_for_each_reverse(c, &clients, link) { - if (!c->mapped) { - /* An unmapped client should not be rendered. */ - continue; - } struct render_data rdata = { .output = m->wlr_output, .when = &now, @@ -940,7 +933,7 @@ unmapnotify(struct wl_listener *listener, void *data) { /* Called when the surface is unmapped, and should no longer be shown. */ Client *c = wl_container_of(listener, c, unmap); - c->mapped = false; + wl_list_remove(&c->link); } Client *