doc update, and window_settrans return status

This commit is contained in:
Julien Danjou 2008-01-12 23:18:10 +01:00
parent 01f2f573b7
commit 8d2f292bef
2 changed files with 11 additions and 7 deletions

View File

@ -31,6 +31,7 @@ extern AwesomeConf globalconf;
/** Set client WM_STATE property /** Set client WM_STATE property
* \param win Window * \param win Window
* \param state state * \param state state
* \return XChangeProperty result
*/ */
int int
window_setstate(Window win, long state) 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); return XSendEvent(globalconf.display, win, False, StructureNotifyMask, (XEvent *) & ce);
} }
/** Grab or ungrab buttons on a window /** Grab or ungrab buttons on a window
* \param screen The screen * \param screen The screen
* \param win The window * \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); XShapeCombineShape(globalconf.display, RootWindow(globalconf.display, screen), ShapeBounding, 0, 0, win, ShapeBounding, ShapeSet);
} }
void int
window_settrans(Window win, double opacity) window_settrans(Window win, double opacity)
{ {
int status;
unsigned int real_opacity = 0xffffffff; unsigned int real_opacity = 0xffffffff;
if(opacity >= 0 && opacity <= 100) if(opacity >= 0 && opacity <= 100)
{ {
real_opacity = ((opacity / 100.0) * 0xffffffff); real_opacity = ((opacity / 100.0) * 0xffffffff);
XChangeProperty(globalconf.display, win, XInternAtom(globalconf.display, "_NET_WM_WINDOW_OPACITY", False), status = XChangeProperty(globalconf.display, win,
XInternAtom(globalconf.display, "_NET_WM_WINDOW_OPACITY", False),
XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &real_opacity, 1L); XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &real_opacity, 1L);
} }
else 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 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -32,7 +32,7 @@ long window_getstate(Window);
Status window_configure(Window, Area, int); Status window_configure(Window, Area, int);
void window_grabbuttons(int, Window, Bool, Bool); void window_grabbuttons(int, Window, Bool, Bool);
void window_setshape(int, Window); void window_setshape(int, Window);
void window_settrans(Window, double); int window_settrans(Window, double);
#endif #endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80