diff --git a/window.c b/window.c index 9fdc7e1e..c1a149f2 100644 --- a/window.c +++ b/window.c @@ -31,6 +31,7 @@ extern AwesomeConf globalconf; /** Set client WM_STATE property * \param win Window * \param state state + * \return XChangeProperty result */ int window_setstate(Window win, long state) @@ -83,8 +84,6 @@ window_configure(Window win, Area geometry, int border) return XSendEvent(globalconf.display, win, False, StructureNotifyMask, (XEvent *) & ce); } - - /** Grab or ungrab buttons on a window * \param screen The screen * \param win The window @@ -155,19 +154,24 @@ window_setshape(int screen, Window win) XShapeCombineShape(globalconf.display, RootWindow(globalconf.display, screen), ShapeBounding, 0, 0, win, ShapeBounding, ShapeSet); } -void +int window_settrans(Window win, double opacity) { + int status; unsigned int real_opacity = 0xffffffff; if(opacity >= 0 && opacity <= 100) { real_opacity = ((opacity / 100.0) * 0xffffffff); - XChangeProperty(globalconf.display, win, XInternAtom(globalconf.display, "_NET_WM_WINDOW_OPACITY", False), - XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &real_opacity, 1L); + status = XChangeProperty(globalconf.display, win, + XInternAtom(globalconf.display, "_NET_WM_WINDOW_OPACITY", False), + XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &real_opacity, 1L); } else - XDeleteProperty(globalconf.display, win, XInternAtom(globalconf.display, "_NET_WM_WINDOW_OPACITY", False)); + status = XDeleteProperty(globalconf.display, win, + XInternAtom(globalconf.display, "_NET_WM_WINDOW_OPACITY", False)); + + return status; } // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/window.h b/window.h index 1c790283..de43c086 100644 --- a/window.h +++ b/window.h @@ -32,7 +32,7 @@ long window_getstate(Window); Status window_configure(Window, Area, int); void window_grabbuttons(int, Window, Bool, Bool); void window_setshape(int, Window); -void window_settrans(Window, double); +int window_settrans(Window, double); #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80