Move atom "UTF8_STRING" to atoms module

This commit is contained in:
Alex Kotov 2021-11-13 03:36:10 +05:00
parent 0312e3a85d
commit ec0402f958
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
3 changed files with 4 additions and 4 deletions

View File

@ -32,6 +32,8 @@ Atoms atoms_create(Display *const dpy)
atoms->xatom[Xembed] = XInternAtom(dpy, "_XEMBED", False);
atoms->xatom[XembedInfo] = XInternAtom(dpy, "_XEMBED_INFO", False);
atoms->utf8string = XInternAtom(dpy, "UTF8_STRING", False);
return atoms;
}

View File

@ -18,7 +18,7 @@ enum { Manager, Xembed, XembedInfo, XLast };
enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast };
typedef struct Atoms {
Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
Atom wmatom[WMLast], netatom[NetLast], xatom[XLast], utf8string;
} *Atoms;
Atoms atoms_create(Display *dpy);

4
dwm.c
View File

@ -1829,7 +1829,6 @@ setup(void)
{
int i;
XSetWindowAttributes wa;
Atom utf8string;
/* clean up any zombies immediately */
sigchld(0);
@ -1846,7 +1845,6 @@ setup(void)
bh = drw->fonts->h + 2;
updategeom();
/* init atoms */
utf8string = XInternAtom(dpy, "UTF8_STRING", False);
atoms = atoms_create(dpy);
/* init cursors */
cursor[CurNormal] = drw_cur_create(drw, XC_left_ptr);
@ -1865,7 +1863,7 @@ setup(void)
wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0);
XChangeProperty(dpy, wmcheckwin, atoms->netatom[NetWMCheck], XA_WINDOW, 32,
PropModeReplace, (unsigned char *) &wmcheckwin, 1);
XChangeProperty(dpy, wmcheckwin, atoms->netatom[NetWMName], utf8string, 8,
XChangeProperty(dpy, wmcheckwin, atoms->netatom[NetWMName], atoms->utf8string, 8,
PropModeReplace, (unsigned char *) "dwm", 3);
XChangeProperty(dpy, root, atoms->netatom[NetWMCheck], XA_WINDOW, 32,
PropModeReplace, (unsigned char *) &wmcheckwin, 1);