Bug fix #149: --opacity-rule misbehaves on 32-bit systems & others

- Fix a bug that --opacity-rule misbehaves with a value higher than 50%
  on 32-bit systems. Thanks to mrinx for reporting. (#149)

- Fix a bug that opacity-rule in configuration file does not work.
This commit is contained in:
Richard Grenville
2013-10-01 23:20:22 +08:00
parent fc8ec8851f
commit 796e2c6fec
3 changed files with 27 additions and 7 deletions

View File

@ -476,9 +476,10 @@ win_has_frame(const win *w) {
}
static inline void
wid_set_opacity_prop(session_t *ps, Window wid, long val) {
wid_set_opacity_prop(session_t *ps, Window wid, opacity_t val) {
const unsigned long v = val;
XChangeProperty(ps->dpy, wid, ps->atom_opacity, XA_CARDINAL, 32,
PropModeReplace, (unsigned char *) &val, 1);
PropModeReplace, (unsigned char *) &v, 1);
}
static inline void