add colorspace fix for window borders with transparency
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmHjJZkACgkQO3+8IhRO Y5jSkA/8DArEaIy0MJBh+llXZPNN/kmCm2hjUixaTC78mheZGorQhYz87EO5vC5+ p5XSSHXRCvmqGSwZ5VVCg2e4bOzVAOBwYVYdZP5pGCbiRfuT/13fknVZbZSvt+UN AAizO1vU+6uQAfhtOpGXXyN62A1aaj6WBYC9GhlTGV9rUjYOFNS9PGsZ24KSkM9F PoS43Yb+BUmvvqgvruZaZ8euuMbN8h39O6mt7/AeSo6ZXdeFniq1+tPGC2exWxq8 +n4mIau606PB0K8ISZqFH6p57W+RzE5zL1Cy+3Sx0xzsjEuugFpVraXrtT+BmSHB fBd34nY7M6lHCTRjPVgFKQDNeBFyhSF67sTIvJ4SWiGoxxov0mmBh3vKt+8Bcu86 2WsFTPob/fVryA0hGllpPsq1DP5hM1F3DX+xVZTZgLo9B8pE+eMBAVkqO0G4q3xx gWXJ3B0XcusfI4gMhN+/uDS62rsR0eCK3V26l5Y44Olnn4iHRQ1n6e+PS1ZnkoO6 Lh0cHCXsJI2HhxOSMNVRbovY7hMwtf6a/XvEmbKZR0pFC46pui5sAn3VCpCzOzn7 xyXKgKEw8eKFow+Uu3usmztjUFB8LgOnUuPIEyHLXK/Xw0710a+g+Kssm7aApVtT gFyesw+oWo/5YCGAQ4QsILPPERWCDKYv/9Oa2zEDhigDrP/UwQ4= =agdE -----END PGP SIGNATURE-----
1 files changed,
13 insertions(+),
1 deletions(-)
jump to
M
src/FbTk/FbWindow.cc
→
src/FbTk/FbWindow.cc
@@ -252,7 +252,19 @@ XFreePixmap(display(), newbg);
} void FbWindow::setBorderColor(const FbTk::Color &border_color) { - XSetWindowBorder(display(), m_window, border_color.pixel()); + unsigned long pixel = border_color.pixel(); + XWindowAttributes attr; + if (XGetWindowAttributes(display(), m_window, &attr) + && attr.colormap != DefaultColormap(display(), m_screen_num)) { + XColor color; + color.red = border_color.red() * 0x101; + color.green = border_color.green() * 0x101; + color.blue = border_color.blue() * 0x101; + if (XAllocColor(display(), attr.colormap, &color)){ + pixel = color.pixel; + } + } + XSetWindowBorder(display(), m_window, pixel); m_border_color = border_color.pixel(); }