remove Display arg of xgettextprop()

This commit is contained in:
Julien Danjou 2008-01-06 22:53:40 +01:00
parent d16b11bb30
commit a5c86280b3
5 changed files with 9 additions and 10 deletions

View File

@ -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

View File

@ -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')

View File

@ -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);

View File

@ -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);

View File

@ -25,7 +25,7 @@
#include <X11/Xlib.h>
#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;