documentation and simplify uicb_settrans

This commit is contained in:
Julien Danjou 2007-09-11 13:14:43 +02:00
parent 59f6cbf2f5
commit cf3135b6cf
1 changed files with 17 additions and 22 deletions

View File

@ -105,9 +105,9 @@ grabbuttons(Client * c, Bool focused, KeySym modkey, unsigned int numlockmask)
} }
} }
/** XXX: No idea /** Check if client supports protocol WM_DELETE_WINDOW
* \param c the client * \param c the client
* \return True if atom has WM_DELETE_WINDOW * \return True if client has WM_DELETE_WINDOW
*/ */
static Bool static Bool
isprotodel(Client * c) isprotodel(Client * c)
@ -126,7 +126,7 @@ isprotodel(Client * c)
return ret; return ret;
} }
/** XXX: No idea /** Set client WM_STATE property
* \param c the client * \param c the client
* \param state no idea * \param state no idea
*/ */
@ -161,7 +161,6 @@ setclienttrans(Client *c, double opacity)
XSync(c->display, False); XSync(c->display, False);
} }
/* extern */
/** Attach client to the beginning of the clients stack /** Attach client to the beginning of the clients stack
* \param c the client * \param c the client
@ -630,26 +629,22 @@ uicb_settrans(Display *disp __attribute__ ((unused)),
if(!sel) if(!sel)
return; return;
if(arg && sscanf(arg, "%lf", &delta)) if(arg && sscanf(arg, "%lf", &delta) && (arg[0] == '+' || arg[0] == '-'))
{ {
if(arg[0] == '+' || arg[0] == '-') XGetWindowProperty(sel->display, sel->win, XInternAtom(sel->display, "_NET_WM_WINDOW_OPACITY", False),
0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left,
(unsigned char **) &data);
if(data)
{ {
XGetWindowProperty(sel->display, sel->win, XInternAtom(sel->display, "_NET_WM_WINDOW_OPACITY", False), unsigned int current_opacity = 0;
0L, 1L, False, XA_CARDINAL, &actual, &format, &n, &left, memcpy(&current_opacity, data, sizeof(unsigned int));
(unsigned char **) &data); XFree((void *) data);
if(data) delta += ((current_opacity * 100.0) / 0xffffffff);
{ }
unsigned int current_opacity = 0; else
memcpy(&current_opacity, data, sizeof(unsigned int)); {
XFree((void *) data); delta += 100.0;
delta += ((current_opacity * 100.0) / 0xffffffff); set_prop = 1;
}
else
{
delta += 100.0;
set_prop = 1;
}
} }
} }