diff --git a/client.c b/client.c index 1a5d8a80..94e2d89a 100644 --- a/client.c +++ b/client.c @@ -16,7 +16,7 @@ extern int sx, sy, sw, sh; /* screen geometry */ extern int wax, way, wah, waw; /* windowarea geometry */ extern Client *clients, *sel, *stack; /* global client list and stack */ -extern Atom jdwmprops, wmatom[WMLast], netatom[NetLast]; +extern Atom wmatom[WMLast], netatom[NetLast]; /** Attach client stack to clients stacks * \param c the client @@ -313,7 +313,7 @@ loadprops(Client * c, int ntags) prop = p_new(char, ntags + 2); - if(gettextprop(c->display, c->win, jdwmprops, prop, ntags + 2)) + if(gettextprop(c->display, c->win, JDWMPROPS_ATOM(c->display), prop, ntags + 2)) { for(i = 0; i < ntags && prop[i]; i++) if((c->tags[i] = prop[i] == '1')) @@ -511,7 +511,7 @@ saveprops(Client * c, int ntags) prop[++i] = '\0'; - XChangeProperty(c->display, c->win, jdwmprops, XA_STRING, 8, + XChangeProperty(c->display, c->win, JDWMPROPS_ATOM(c->display), XA_STRING, 8, PropModeReplace, (unsigned char *) prop, i); p_delete(&prop); diff --git a/jdwm.c b/jdwm.c index c6e90030..7b1891f8 100644 --- a/jdwm.c +++ b/jdwm.c @@ -19,7 +19,7 @@ #include "tag.h" int screen, sx, sy, sw, sh, wax, way, waw, wah; -Atom jdwmprops, wmatom[WMLast], netatom[NetLast]; +Atom wmatom[WMLast], netatom[NetLast]; Client *clients = NULL; Client *sel = NULL; Client *stack = NULL; @@ -148,7 +148,6 @@ setup(Display *disp, jdwm_config *jdwmconf) XSetWindowAttributes wa; /* init atoms */ - jdwmprops = XInternAtom(disp, "_JDWM_PROPERTIES", False); wmatom[WMProtocols] = XInternAtom(disp, "WM_PROTOCOLS", False); wmatom[WMDelete] = XInternAtom(disp, "WM_DELETE_WINDOW", False); wmatom[WMName] = XInternAtom(disp, "WM_NAME", False); diff --git a/layout.c b/layout.c index 2942b7f3..99c40848 100644 --- a/layout.c +++ b/layout.c @@ -14,7 +14,6 @@ extern int wax, way, wah, waw; /* windowarea geometry */ extern Window barwin; extern Client *clients, *sel; /* global client list */ -extern Atom jdwmprops; extern DC dc; void @@ -81,7 +80,7 @@ loadjdwmprops(Display *disp, jdwm_config * jdwmconf) prop = p_new(char, jdwmconf->ntags + 1); - if(gettextprop(disp, DefaultRootWindow(disp), jdwmprops, prop, jdwmconf->ntags + 1)) + if(gettextprop(disp, DefaultRootWindow(disp), JDWMPROPS_ATOM(disp), prop, jdwmconf->ntags + 1)) for(i = 0; i < jdwmconf->ntags && prop[i]; i++) jdwmconf->selected_tags[i] = prop[i] == '1'; @@ -131,7 +130,9 @@ savejdwmprops(Display *disp, jdwm_config *jdwmconf) for(i = 0; i < jdwmconf->ntags; i++) prop[i] = jdwmconf->selected_tags[i] ? '1' : '0'; prop[i] = '\0'; - XChangeProperty(disp, DefaultRootWindow(disp), jdwmprops, XA_STRING, 8, PropModeReplace, (unsigned char *) prop, i); + XChangeProperty(disp, DefaultRootWindow(disp), + JDWMPROPS_ATOM(disp), XA_STRING, 8, + PropModeReplace, (unsigned char *) prop, i); p_delete(&prop); } diff --git a/layout.h b/layout.h index a9565417..7a8b9f89 100644 --- a/layout.h +++ b/layout.h @@ -8,6 +8,8 @@ /** Check if current layout is arranged with a layout */ #define IS_ARRANGE(layout) (layout == jdwmconf->current_layout->arrange) +#define JDWMPROPS_ATOM(disp) XInternAtom(disp, "_JDWM_PROPERTIES", False) + void arrange(Display *, jdwm_config *); /* arranges all windows depending on the layout in use */ void restack(Display *, jdwm_config *); /* restores z layers of all clients */ void uicb_focusnext(Display *, jdwm_config *, const char *); /* focuses next visible client */