New feature: EWMH Support ! #1

This commit is contained in:
Martin Duquesnoy
2008-12-14 15:43:21 +01:00
parent 199a148689
commit f8d1049240
17 changed files with 410 additions and 107 deletions

View File

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