diff --git a/client.c b/client.c index cea331b9..31b7bbdd 100644 --- a/client.c +++ b/client.c @@ -58,7 +58,7 @@ client_loadprops(Client * c, int screen) prop = p_new(char, ntags + 2); - if(xgettextprop(globalconf.display, c->win, AWESOMEPROPS_ATOM(globalconf.display), prop, ntags + 2)) + if(xgettextprop(c->win, AWESOMEPROPS_ATOM(globalconf.display), prop, ntags + 2)) { for(i = 0, tag = globalconf.screens[screen].tags; tag && i < ntags && prop[i]; i++, tag = tag->next) if(prop[i] == '1') @@ -172,8 +172,8 @@ get_client_byname(Client *list, char *name) void client_updatetitle(Client *c) { - if(!xgettextprop(globalconf.display, c->win, XInternAtom(globalconf.display, "_NET_WM_NAME", False), c->name, sizeof(c->name))) - xgettextprop(globalconf.display, c->win, XInternAtom(globalconf.display, "WM_NAME", False), c->name, sizeof(c->name)); + if(!xgettextprop(c->win, XInternAtom(globalconf.display, "_NET_WM_NAME", False), c->name, sizeof(c->name))) + xgettextprop(c->win, XInternAtom(globalconf.display, "WM_NAME", False), c->name, sizeof(c->name)); } /** Ban client and unmap it diff --git a/layout.c b/layout.c index 45f8b389..e628c2da 100644 --- a/layout.c +++ b/layout.c @@ -141,8 +141,7 @@ loadawesomeprops(int screen) prop = p_new(char, ntags + 1); - if(xgettextprop(globalconf.display, - RootWindow(globalconf.display, get_phys_screen(screen)), + if(xgettextprop(RootWindow(globalconf.display, get_phys_screen(screen)), AWESOMEPROPS_ATOM(globalconf.display), prop, ntags + 1)) for(i = 0, tag = globalconf.screens[screen].tags; tag && prop[i]; i++, tag = tag->next) if(prop[i] == '1') diff --git a/rules.c b/rules.c index 533a6d86..702ad2fe 100644 --- a/rules.c +++ b/rules.c @@ -78,7 +78,7 @@ client_match_rule(Client *c, Rule *r) if(r->xprop && r->xpropval_r - && xgettextprop(globalconf.display, c->win, + && xgettextprop(c->win, XInternAtom(globalconf.display, r->xprop, False), buf, ssizeof(buf))) ret = !regexec(r->xpropval_r, buf, 1, &tmp, 0); diff --git a/xutil.c b/xutil.c index b3d7282f..0f118de8 100644 --- a/xutil.c +++ b/xutil.c @@ -92,7 +92,7 @@ uicb_spawn(int screen, char *arg) } Bool -xgettextprop(Display *disp, Window w, Atom atom, char *text, ssize_t textlen) +xgettextprop(Window w, Atom atom, char *text, ssize_t textlen) { char **list = NULL; int n; @@ -103,7 +103,7 @@ xgettextprop(Display *disp, Window w, Atom atom, char *text, ssize_t textlen) return False; text[0] = '\0'; - XGetTextProperty(disp, w, &name, atom); + XGetTextProperty(globalconf.display, w, &name, atom); if(!name.nitems) return False; @@ -111,7 +111,7 @@ xgettextprop(Display *disp, Window w, Atom atom, char *text, ssize_t textlen) if(name.encoding == XA_STRING) a_strncpy(text, textlen, (char *) name.value, textlen - 1); - else if(XmbTextPropertyToTextList(disp, &name, &list, &n) >= Success && n > 0 && *list) + else if(XmbTextPropertyToTextList(globalconf.display, &name, &list, &n) >= Success && n > 0 && *list) { a_strncpy(text, textlen, *list, textlen - 1); XFreeStringList(list); diff --git a/xutil.h b/xutil.h index c4398a6a..3eb60635 100644 --- a/xutil.h +++ b/xutil.h @@ -25,7 +25,7 @@ #include #include "uicb.h" -Bool xgettextprop(Display *, Window, Atom, char *, ssize_t); +Bool xgettextprop(Window, Atom, char *, ssize_t); XColor initxcolor(int, const char *); Uicb uicb_spawn; Uicb uicb_exec;