New feature: EWMH Support ! #1
This commit is contained in:
26
src/util.c
26
src/util.c
@@ -57,7 +57,7 @@ getcolor(char *color)
|
||||
{
|
||||
XColor xcolor;
|
||||
|
||||
if(!XAllocNamedColor(dpy, DefaultColormap(dpy, screen), color, &xcolor, &xcolor))
|
||||
if(!XAllocNamedColor(dpy, DefaultColormap(dpy, SCREEN), color, &xcolor, &xcolor))
|
||||
fprintf(stderr,"WMFS Error: cannot allocate color \"%s\"\n", color);
|
||||
return xcolor.pixel;
|
||||
}
|
||||
@@ -78,30 +78,6 @@ color_enlight(ulong col)
|
||||
|
||||
}
|
||||
|
||||
/** Get a Window WM State
|
||||
* \param win Window
|
||||
* \return The state
|
||||
*/
|
||||
long
|
||||
getwinstate(Window win)
|
||||
{
|
||||
int f;
|
||||
long ret = -1;
|
||||
ulong n, e;
|
||||
uchar *p = NULL;
|
||||
Atom at;
|
||||
|
||||
if(XGetWindowProperty(dpy, win, ATOM("WM_STATE"), 0L, 2L, False,
|
||||
ATOM("WM_STATE"), &at, &f, &n, &e, (uchar **)&p) != Success)
|
||||
return -1;
|
||||
|
||||
if(n != 0)
|
||||
ret = *p;
|
||||
XFree(p);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** Round function
|
||||
* \param x double type
|
||||
* \return the round of x
|
||||
|
||||
Reference in New Issue
Block a user