aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-08-03 12:22:02 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-08-03 12:22:02 -0500
commit27bbf9c14f81c5b09bfe2a0378c8e1f96ab89160 (patch)
treefd8ea7deaeec28850719259ce6214d55ad821a60 /dwl.c
parentc12261d3a98899348cbba894b376e2f071af8f60 (diff)
condense getatom and add note about error return
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dwl.c b/dwl.c
index c700776..804adae 100644
--- a/dwl.c
+++ b/dwl.c
@@ -765,13 +765,11 @@ Atom
getatom(xcb_connection_t *xc, const char *name)
{
Atom atom = 0;
- xcb_generic_error_t *error;
xcb_intern_atom_cookie_t cookie;
xcb_intern_atom_reply_t *reply;
cookie = xcb_intern_atom(xc, 0, strlen(name), name);
- reply = xcb_intern_atom_reply(xc, cookie, &error);
- if (reply != NULL && error == NULL)
+ if ((reply = xcb_intern_atom_reply(xc, cookie, NULL)))
atom = reply->atom;
free(reply);
@@ -1722,7 +1720,8 @@ xwaylandready(struct wl_listener *listener, void *data) {
return;
}
- /* collect atoms we are interested in */
+ /* Collect atoms we are interested in. If getatom returns 0, we will
+ * not detect that window type. */
netatom[NetWMWindowTypeDialog] = getatom(xc, "_NET_WM_WINDOW_TYPE_DIALOG");
netatom[NetWMWindowTypeSplash] = getatom(xc, "_NET_WM_WINDOW_TYPE_SPLASH");
netatom[NetWMWindowTypeUtility] = getatom(xc, "_NET_WM_WINDOW_TYPE_TOOLBAR");