remove Display arg of xgettextprop()
This commit is contained in:
parent
d16b11bb30
commit
a5c86280b3
6
client.c
6
client.c
|
@ -58,7 +58,7 @@ client_loadprops(Client * c, int screen)
|
||||||
|
|
||||||
prop = p_new(char, ntags + 2);
|
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)
|
for(i = 0, tag = globalconf.screens[screen].tags; tag && i < ntags && prop[i]; i++, tag = tag->next)
|
||||||
if(prop[i] == '1')
|
if(prop[i] == '1')
|
||||||
|
@ -172,8 +172,8 @@ get_client_byname(Client *list, char *name)
|
||||||
void
|
void
|
||||||
client_updatetitle(Client *c)
|
client_updatetitle(Client *c)
|
||||||
{
|
{
|
||||||
if(!xgettextprop(globalconf.display, c->win, XInternAtom(globalconf.display, "_NET_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(globalconf.display, c->win, XInternAtom(globalconf.display, "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
|
/** Ban client and unmap it
|
||||||
|
|
3
layout.c
3
layout.c
|
@ -141,8 +141,7 @@ loadawesomeprops(int screen)
|
||||||
|
|
||||||
prop = p_new(char, ntags + 1);
|
prop = p_new(char, ntags + 1);
|
||||||
|
|
||||||
if(xgettextprop(globalconf.display,
|
if(xgettextprop(RootWindow(globalconf.display, get_phys_screen(screen)),
|
||||||
RootWindow(globalconf.display, get_phys_screen(screen)),
|
|
||||||
AWESOMEPROPS_ATOM(globalconf.display), prop, ntags + 1))
|
AWESOMEPROPS_ATOM(globalconf.display), prop, ntags + 1))
|
||||||
for(i = 0, tag = globalconf.screens[screen].tags; tag && prop[i]; i++, tag = tag->next)
|
for(i = 0, tag = globalconf.screens[screen].tags; tag && prop[i]; i++, tag = tag->next)
|
||||||
if(prop[i] == '1')
|
if(prop[i] == '1')
|
||||||
|
|
2
rules.c
2
rules.c
|
@ -78,7 +78,7 @@ client_match_rule(Client *c, Rule *r)
|
||||||
|
|
||||||
if(r->xprop
|
if(r->xprop
|
||||||
&& r->xpropval_r
|
&& r->xpropval_r
|
||||||
&& xgettextprop(globalconf.display, c->win,
|
&& xgettextprop(c->win,
|
||||||
XInternAtom(globalconf.display, r->xprop, False),
|
XInternAtom(globalconf.display, r->xprop, False),
|
||||||
buf, ssizeof(buf)))
|
buf, ssizeof(buf)))
|
||||||
ret = !regexec(r->xpropval_r, buf, 1, &tmp, 0);
|
ret = !regexec(r->xpropval_r, buf, 1, &tmp, 0);
|
||||||
|
|
6
xutil.c
6
xutil.c
|
@ -92,7 +92,7 @@ uicb_spawn(int screen, char *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
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;
|
char **list = NULL;
|
||||||
int n;
|
int n;
|
||||||
|
@ -103,7 +103,7 @@ xgettextprop(Display *disp, Window w, Atom atom, char *text, ssize_t textlen)
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
text[0] = '\0';
|
text[0] = '\0';
|
||||||
XGetTextProperty(disp, w, &name, atom);
|
XGetTextProperty(globalconf.display, w, &name, atom);
|
||||||
|
|
||||||
if(!name.nitems)
|
if(!name.nitems)
|
||||||
return False;
|
return False;
|
||||||
|
@ -111,7 +111,7 @@ xgettextprop(Display *disp, Window w, Atom atom, char *text, ssize_t textlen)
|
||||||
if(name.encoding == XA_STRING)
|
if(name.encoding == XA_STRING)
|
||||||
a_strncpy(text, textlen, (char *) name.value, textlen - 1);
|
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);
|
a_strncpy(text, textlen, *list, textlen - 1);
|
||||||
XFreeStringList(list);
|
XFreeStringList(list);
|
||||||
|
|
2
xutil.h
2
xutil.h
|
@ -25,7 +25,7 @@
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include "uicb.h"
|
#include "uicb.h"
|
||||||
|
|
||||||
Bool xgettextprop(Display *, Window, Atom, char *, ssize_t);
|
Bool xgettextprop(Window, Atom, char *, ssize_t);
|
||||||
XColor initxcolor(int, const char *);
|
XColor initxcolor(int, const char *);
|
||||||
Uicb uicb_spawn;
|
Uicb uicb_spawn;
|
||||||
Uicb uicb_exec;
|
Uicb uicb_exec;
|
||||||
|
|
Loading…
Reference in New Issue